home *** CD-ROM | disk | FTP | other *** search
/ IBM OEM Software Product … CD For PC Manufacturers / IBM OEM Software - Product Sampler CD for PC Manufacturers.iso / InternetIntranets / Notes / INSTALL.DSK / TOOLKIT.LSS < prev    next >
Text File  |  1996-08-06  |  231KB  |  6,509 lines

  1. ''**********************************************************************
  2. ''
  3. ''   Module Name:   cominst\toolkit\toolkit.lss
  4. ''
  5. ''   Module Code:   COMINST
  6. ''
  7. ''   Author:        Dave Dupre
  8. ''
  9. ''   Change History:
  10. ''   $Log:   //CIT/VOL1/CFLOG/logfiles/cominst/toolkit/toolkit@.lss  $
  11. '' 
  12. ''    Rev 1.215.1.1   15 Nov 1995 17:27:12   mhishinu
  13. '' Merged GC5 into FE5
  14. '' 
  15. ''    Rev 1.215.1.0   Oct 19 1995 15:24:04   cmoy
  16. '' merged fe3 to fe5
  17. '' 
  18. ''    Rev 1.215   13 Oct 1995 15:41:14   amontalv
  19. '' For some reason the routine FGetListLength() was losing the symbol passed to it
  20. '' if it was called a second time.  We put a check in to make sure it doesn't.
  21. '' 
  22. ''    Rev 1.214   27 Sep 1995 11:18:44   jdonohue
  23. '' Don't change the destination directory symbols for non-server language instal
  24. '' 
  25. ''    Rev 1.213   22 Sep 1995 15:46:06   tveerapp
  26. '' Fixed spr#TBAT2W9U2Q. Lot_whereisfetaure was extended to look in the net
  27. '' components directory.
  28. '' 
  29. ''    Rev 1.212   22 Sep 1995 15:07:24   jdonohue
  30. '' Remove SYM_LOTUSUSERDIR$ processing
  31. '' 
  32. ''    Rev 1.211   15 Sep 1995 19:59:20   amontalv
  33. '' Added Lot_GetVol() and Lot_SplitAnyPath().
  34. '' 
  35. ''    Rev 1.210   14 Sep 1995 15:35:04   amontalv
  36. '' Don't register system path!
  37. '' 
  38. ''    Rev 1.209   14 Sep 1995 14:58:22   amontalv
  39. '' Added comments
  40. '' 
  41. ''    Rev 1.208   13 Sep 1995 17:03:06   amontalv
  42. '' Moved Lot_RegAppPath from setupapi.lss to toolkit.lss and also added a parameter.
  43. '' Lot_RegAppPath now register the registry entry .
  44. '' 
  45. ''    Rev 1.207   13 Sep 1995 14:20:22   glutz
  46. '' Added function GetLastPathComponent.
  47. '' 
  48. ''    Rev 1.206   12 Sep 1995 18:56:24   glutz
  49. '' Cleaned up some error reporting in ValidatePath, ValidateEditBox and
  50. '' ValidateBrowse.
  51. '' 
  52. ''    Rev 1.205   12 Sep 1995 11:55:54   tveerapp
  53. '' Added Lot_SaveFeaturesInInstNodeIni(), PopulateCINSTNODELIST .
  54. '' 
  55. ''    Rev 1.204   12 Sep 1995 11:18:18   glutz
  56. '' In ValidatePath set SYM_LAST_ERROR_SID to readonly before calling
  57. '' IsPathWritable.
  58. '' 
  59. ''    Rev 1.203   08 Sep 1995 14:41:44   glutz
  60. '' In ValidatePath the call to Lot_cleanPath is indepenent of volume type.
  61. '' 
  62. ''    Rev 1.202   08 Sep 1995 12:38:42   glutz
  63. '' For SPR CCOL2UKQD7 ValidatePath calls Lot_CleanPath first thing for UNC paths
  64. '' 
  65. ''    Rev 1.201   07 Sep 1995 15:22:08   amontalv
  66. '' Chop off the end of icon names longer than 40 characters if in NT.
  67. '' 
  68. ''    Rev 1.200   07 Sep 1995 10:42:26   tveerapp
  69. '' Added fix for node install network mapping in Lot_GetDestDirFromInstallIni.
  70. '' 
  71. ''    Rev 1.199   31 Aug 1995 14:00:48   tveerapp
  72. '' Fixed GetSymbolValue arg when building cinstnod.ini path
  73. '' 
  74. ''    Rev 1.198   31 Aug 1995 12:58:10   tveerapp
  75. '' NodeInstIni file path was not built correctly.Fix for spr# DCRP2UWNLS
  76. '' 
  77. ''    Rev 1.197   28 Aug 1995 16:53:00   jdonohue
  78. '' Changed USERDIR to LOTUSUSERDIR, lotususr to lotuser
  79. '' 
  80. ''    Rev 1.196   28 Aug 1995 13:32:14   amontalv
  81. '' Changed the uninstall entry to always be under \HLM\SOFTWARE\Microsoft\Windows\...
  82. '' and not \HLM\SOFTWARE\Microsoft\Windows NT\... when in NT.  Microsoft does this
  83. '' and it avoids security issues.
  84. '' 
  85. ''    Rev 1.195   24 Aug 1995 07:55:58   jdonohue
  86. '' Added SYM_USERDIR and set it
  87. '' 
  88. ''    Rev 1.194   23 Aug 1995 15:35:32   cmoy
  89. '' Added CONST MAX_NO_DRIVE_COMBOS
  90. '' 
  91. ''    Rev 1.193   21 Aug 1995 15:41:40   amontalv
  92. '' Put name of registry keys into globals.lss
  93. '' 
  94. ''    Rev 1.192   16 Aug 1995 20:33:28   amontalv
  95. '' Added code to do error messages for registry.
  96. '' 
  97. ''    Rev 1.191   16 Aug 1995 12:27:46   mmeth
  98. '' fix for  SPR# DCRP2UWNS9
  99. '' The node install was trying to write the path to the install directory
  100. '' into the registry.  Instead, we needed to write the path to the 
  101. '' target directory.
  102. '' 
  103. ''    Rev 1.190   15 Aug 1995 12:32:34   glutz
  104. '' Had to set the text for "Path not writable" just before displaying message.
  105. '' 
  106. ''    Rev 1.189   14 Aug 1995 17:00:22   amontalv
  107. '' During creation of Uninstall program group icon, I needed to point to the file again
  108. '' in the fourth parameter.  I though that that was starting directory, but seems to
  109. '' deal with icon.
  110. '' 
  111. ''    Rev 1.188   14 Aug 1995 11:12:28   jdonohue
  112. '' Allow filenames with more than 12 characters in MakePath
  113. '' 
  114. ''    Rev 1.187   09 Aug 1995 12:01:46   cmoy
  115. '' Commented out ProdAcronym variable. This is  not used
  116. '' 
  117. ''    Rev 1.186   Aug 09 1995 11:49:16   cmoy
  118. '' remove declaration on LOT_WRITECRITICALDIRECTORIES
  119. '' 
  120. ''    Rev 1.185   08 Aug 1995 12:55:14   tveerapp
  121. '' Added Lot_WriteCriticalDirectories. It is called in Lot_SaveFeaturesInInstal
  122. '' Ini. 
  123. '' 
  124. ''    Rev 1.184   07 Aug 1995 11:49:32   tveerapp
  125. '' Added a new function Lot_GetDestDirSymFrom InstallIni().
  126. '' 
  127. ''    Rev 1.183   07 Aug 1995 09:14:02   mmeth
  128. '' Fixed a typo I put in wrt a comment character.
  129. '' 
  130. ''    Rev 1.182   07 Aug 1995 08:24:52   mmeth
  131. '' Part 2 of fix for SPR# JHOH2M4HZL:
  132. '' No longer check length of strings being written in Lot_WriteToRiFile.
  133. '' Because this C function now truncates the length to 80 bytes + terminator
  134. '' itsself.  ALso changed the length of buffers to 82 in Lot_ReadDefaultsfromRi
  135. '' to handle the 80 bytes of characters plus terminating character.
  136. '' 
  137. ''    Rev 1.181   05 Aug 1995 13:27:10   jdonohue
  138. '' Backed out code to eliminate non-network drives for server install
  139. '' 
  140. ''    Rev 1.180   04 Aug 1995 17:27:08   amontalv
  141. '' Fixed command for uninstall icon.
  142. '' 
  143. ''    Rev 1.179   04 Aug 1995 16:38:36   glutz
  144. '' More subtle changes to ValidatePath.
  145. '' 
  146. ''    Rev 1.178   04 Aug 1995 12:24:04   glutz
  147. '' Cleaned up a problem displaying errors from ValidatePath.
  148. '' 
  149. ''    Rev 1.177   04 Aug 1995 08:42:58   glutz
  150. '' Changed the way ValidatePath handle some error messages.
  151. '' 
  152. ''    Rev 1.176   03 Aug 1995 15:41:22   amontalv
  153. '' Added one to length of registry entry for Uninstall.
  154. '' 
  155. ''    Rev 1.175   03 Aug 1995 15:32:42   glutz
  156. '' Changing method for error mesaages in ValidatePath.
  157. '' 
  158. ''    Rev 1.174   02 Aug 1995 16:20:10   amontalv
  159. '' Changed uninstall flags.  /L -> /O and /P -> /L
  160. '' 
  161. ''    Rev 1.173   02 Aug 1995 10:03:44   glutz
  162. '' Added unc volumes to server list in Lot_GetDriveFreeSpaceList.
  163. '' 
  164. ''    Rev 1.172   01 Aug 1995 16:14:52   amontalv
  165. '' Added uninstall information for ininstall icon
  166. '' 
  167. ''    Rev 1.171   01 Aug 1995 11:04:04   glutz
  168. '' Changed the order of some of the checks in ValidatePath so that UNC roots
  169. '' would be checked before invalid path names.
  170. '' 
  171. ''    Rev 1.170   31 Jul 1995 15:00:26   jdonohue
  172. '' Moved Reg_??? functions to Register.lss
  173. '' Added code to select only network drives for server install
  174. '' 
  175. ''    Rev 1.169   31 Jul 1995 10:54:28   amontalv
  176. '' No change
  177. '' 
  178. ''    Rev 1.168   28 Jul 1995 11:59:26   glutz
  179. '' IsPathWritable now passes the UNC path to Lot_CheckPath.
  180. '' 
  181. ''    Rev 1.167   27 Jul 1995 16:18:42   pdonahue
  182. '' added code to surface new error message 
  183. '' 
  184. ''    Rev 1.166   27 Jul 1995 14:01:34   amontalv
  185. '' Added call to create icons for uninstall in WinNt.
  186. '' 
  187. ''    Rev 1.165   27 Jul 1995 11:04:28   amontalv
  188. '' Added call Lot_AddLinkIconToFolder so that icon information can be sent
  189. '' when creating a shortcut.
  190. '' 
  191. ''    Rev 1.164   24 Jul 1995 11:39:38   glutz
  192. '' Read sn.dat from temp directory.
  193. '' 
  194. ''    Rev 1.163   20 Jul 1995 12:58:52   jdonohue
  195. '' Changed CopyFile to FCopyFile, which calls Win32 CopyFile instead of MS-Setup
  196. '' FCopyOneFile
  197. '' 
  198. ''    Rev 1.162   20 Jul 1995 10:53:54   glutz
  199. '' GetFreeSpace now returns K bytes so I made changes accordingly.
  200. '' 
  201. ''    Rev 1.161   20 Jul 1995 08:02:48   jdonohue
  202. '' Added check for null string in ValidatePath
  203. '' 
  204. ''    Rev 1.160   19 Jul 1995 16:37:24   glutz
  205. '' lcbNeed is now K bytes based so I took the \ 1024 out of CheskForSpace.
  206. '' 
  207. ''    Rev 1.159   18 Jul 1995 09:17:26   glutz
  208. '' ValidateBrowse was not updating edit box for UNC paths.
  209. '' 
  210. ''    Rev 1.158   17 Jul 1995 16:38:06   glutz
  211. '' Added function ValidateBrowse to set the combo and edit boxes after a browse.
  212. '' 
  213. ''    Rev 1.157   17 Jul 1995 15:52:12   glutz
  214. '' ValidatePath was checking path length before it was cleaning the path
  215. '' This would allow installation to \flw\..\
  216. '' 
  217. ''    Rev 1.156   17 Jul 1995 15:32:36   amontalv
  218. '' Changed the prodno in Lot_AddLinkToFolder to always be 1.
  219. '' 
  220. ''    Rev 1.155   17 Jul 1995 13:51:50   amontalv
  221. '' Added "Overview" to Windows Help, so that we would have the new help look.
  222. '' 
  223. ''    Rev 1.154   17 Jul 1995 13:33:08   glutz
  224. '' All error messages concerning paths are suppressed if a UNC volume
  225. '' cannot be mapped to a drive letter.
  226. '' 
  227. ''    Rev 1.153   13 Jul 1995 11:25:34   tveerapp
  228. '' Modified the comments for Reg_GetObsFiles.
  229. '' 
  230. ''    Rev 1.152   13 Jul 1995 11:22:26   tveerapp
  231. '' Added Reg_SetObsFiles, RegGetObsFilesto support Obsolete files flag.
  232. '' 
  233. ''    Rev 1.151   12 Jul 1995 16:53:26   glutz
  234. '' Had to limit the length of the unc volume int the insufficient disk
  235. '' space dialog.
  236. '' 
  237. ''    Rev 1.150   11 Jul 1995 12:09:24   tveerapp
  238. '' Changed Lot_RegiterUinstallhandler, Lot_RegisterObjects to not
  239. '' register during a server, distrbution install.
  240. '' 
  241. ''    Rev 1.149   07 Jul 1995 15:58:32   glutz
  242. '' Added UNC volumes to CheckForSpace routine.
  243. '' 
  244. ''    Rev 1.148   06 Jul 1995 12:23:04   mzgripce
  245. '' change the destination of the uninstaller fron the components directory
  246. '' to the windows directory
  247. '' 
  248. ''    Rev 1.147   28 Jun 1995 15:54:36   tveerapp
  249. '' Fixed EXECUTE requiring Sub Initialize.
  250. '' 
  251. ''    Rev 1.146   27 Jun 1995 15:54:32   mzgripce
  252. '' put the execute string between sub initialize and end sub to enable 
  253. '' on error / error # handeling for share processing
  254. '' 
  255. ''    Rev 1.145   23 Jun 1995 17:09:24   mzgripce
  256. '' fixed jmoy2t4pny pert 2 by compensating if the user starts a path with no \
  257. '' 
  258. ''    Rev 1.144   23 Jun 1995 12:47:42   mzgripce
  259. '' add program_group class 
  260. '' 
  261. ''    Rev 1.143   23 Jun 1995 12:22:12   jdonohue
  262. '' Added FindResourceinDLL function, add global string for name of our generic
  263. '' dialog proc and use in AddToBillboardList (original argument not used)
  264. '' 
  265. ''    Rev 1.142   22 Jun 1995 17:27:08   mzgripce
  266. '' add hive class to register object
  267. '' 
  268. ''    Rev 1.141   22 Jun 1995 12:43:56   jdonohue
  269. '' Revised AddToBillboardList to look for resource in list of DLLs
  270. '' 
  271. ''    Rev 1.140   22 Jun 1995 10:59:00   mzgripce
  272. '' change the cinstnode.ini filename to cinstnod.ini 
  273. '' 
  274. ''    Rev 1.139   21 Jun 1995 14:27:28   glutz
  275. '' Added function ValidateEditBox to check edit box
  276. '' strings for valid letter drives or UNC volumes
  277. '' 
  278. ''    Rev 1.138   19 Jun 1995 18:45:18   mzgripce
  279. '' change lot_callShare to call the sharetools if share or share32 are supported
  280. '' 
  281. ''    Rev 1.137   19 Jun 1995 17:40:12   mzgripce
  282. '' change the key Display Name to DisplayName (for uninstaller)
  283. '' 
  284. ''    Rev 1.136   19 Jun 1995 16:39:44   mzgripce
  285. '' add Lot_RegisterObject
  286. '' 
  287. ''    Rev 1.135   19 Jun 1995 10:27:20   amontalv
  288. '' Put in code to add function to New Folder button and Remove Folder button.  Also
  289. '' fixed some of the selection problems in the tree list.
  290. '' 
  291. ''    Rev 1.134   15 Jun 1995 19:41:30   amontalv
  292. '' Checked for and changed integers passed to C functions.  Changed to longs.
  293. '' 
  294. ''    Rev 1.133   15 Jun 1995 17:52:20   amontalv
  295. '' The problem with the program groups and errors with installed features was that
  296. '' the C code FFindFirst() expected a integer that contained the flag for which to look.
  297. '' In LotusScript when we called this function we passed an integer, but an integer
  298. '' in Script is different than an integer in C.  The fix is to convert the Script
  299. '' integer to a long using Clng() at the call for the C function.
  300. '' 
  301. ''    Rev 1.132   13 Jun 1995 17:27:08   mzgripce
  302. '' import FWriteDestinationSymAndVal, write Lot_WriteDestinationSymAndVal 
  303. '' subroutine and call it in Lot_SaveFeature to register the dir symbols
  304. '' and their values for uninstall
  305. '' 
  306. ''    Rev 1.131   12 Jun 1995 15:10:30   tveerapp
  307. '' Added a check in the function Lot_TrimEndSlash. Checks if the
  308. '' string is of length > 0. Script's MID$ chokes on an empty path string.
  309. '' 
  310. ''    Rev 1.130   09 Jun 1995 17:05:42   mzgripce
  311. '' added Lot_Register_Uninstaller
  312. '' 
  313. ''    Rev 1.129   09 Jun 1995 15:08:54   amontalv
  314. '' Added code to set global variable in START.LSS to error condition value.
  315. '' 
  316. ''    Rev 1.128   09 Jun 1995 14:25:58   glutz
  317. '' Fixed unc mapping bug
  318. '' 
  319. ''    Rev 1.127   09 Jun 1995 11:28:38   jdonohue
  320. '' Send quit message to WinHelp
  321. '' 
  322. ''    Rev 1.126   08 Jun 1995 16:48:54   jdonohue
  323. '' Added cancel option for tight disk space message box
  324. '' 
  325. ''    Rev 1.123   07 Jun 1995 17:50:12   amontalv
  326. '' Set the Selected folder to the root only the first time that
  327. '' Reg_SetProgManagerGroup is called.
  328. '' 
  329. ''    Rev 1.122   07 Jun 1995 16:30:44   amontalv
  330. '' Changed the Win95 start folder so that it initializes
  331. '' earlier in the program.  This should make automation
  332. '' easier to implement for it.  There are still a couple of
  333. '' bugs that I need to work out, but I feel that I should
  334. '' check what I have now.
  335. '' 
  336. ''    Rev 1.121   07 Jun 1995 11:23:24   glutz
  337. '' ValidatePath and IsPathwritable now work with UNC volumes
  338. '' 
  339. ''    Rev 1.120   06 Jun 1995 15:59:28   amontalv
  340. '' We are experiencing problems with LotusScript when we fill buffers with
  341. '' nulls and then pass them to C routines.  For the time being, it is suggested
  342. '' that we fill our buffers with spaces.  To this end (and to make it
  343. '' easier to change back later) I have created a small LotusScript routine
  344. '' named CreateBuffer.  You use it any time you ordinarily would use
  345. '' STRING$(num, 0).  CreateBuffer() just needs the num, it decides what to
  346. '' fill the buffer with (sorry about the grammer).  Right now it fill the
  347. '' buffer with spaces.  Later we will change it back to nulls.  Also look
  348. '' at the routine NullTrim().  It will get rid of final nulls and spaces.
  349. '' You can use this when getting a buffer that has been changed or filled
  350. '' in a external C routine.
  351. '' 
  352. ''    Rev 1.119   06 Jun 1995 15:34:44   mzgripce
  353. '' added 3 fields ti the prods struct to support moreDirectories prompt and
  354. '' 4 CIT functions (one set and three gets) to register this data with CIT
  355. '' 
  356. ''    Rev 1.118   05 Jun 1995 18:15:22   tveerapp
  357. '' Removed SetTheComponentsDir. This is taken care of in InitShare32
  358. '' in share32.lss.
  359. '' 
  360. ''    Rev 1.117   05 Jun 1995 16:37:20   amontalv
  361. '' Made changes for migrating to LotusScript version 3.0.37.
  362. '' 
  363. ''    Rev 1.116   02 Jun 1995 14:49:06   tveerapp
  364. '' Changed IDC_HELP to IDC_CITHELP.
  365. '' 
  366. ''    Rev 1.115   02 Jun 1995 08:54:26   glutz
  367. '' Lot_checkPath calls Lot_SplitUNCPath
  368. '' 
  369. ''    Rev 1.114   01 Jun 1995 17:02:04   glutz
  370. '' Lot_GheckPath works with UNC paths
  371. '' 
  372. ''    Rev 1.113   01 Jun 1995 11:11:44   amontalv
  373. '' Added API function CreateLink to create shortcuts.  Also added functions
  374. '' to save and get the link path to support the CreateLink.  I also changed
  375. '' the startup program folder code to use the default dialog proc and changed
  376. '' the default dialog proc to process directory trees.
  377. '' 
  378. ''    Rev 1.112   31 May 1995 09:52:20   callanan
  379. '' Accessing help from the lotustmp dir not the current directory as the 
  380. '' current directory changes when you change drive.
  381. '' 
  382. ''    Rev 1.111   30 May 1995 15:43:34   amontalv
  383. '' Made a new function PopupWithFunction.  PopupModalDlg now calls this.  Needed to
  384. '' do this to call dialog with my own dialog function.
  385. '' 
  386. ''    Rev 1.110   30 May 1995 13:09:32   jdonohue
  387. '' Pass DLL list in argument to FDoDialog
  388. '' 
  389. ''    Rev 1.109   30 May 1995 10:00:00   amontalv
  390. '' Added routine PopupFolderDlg to put up the Win95 Program folder dialog.
  391. '' 
  392. ''    Rev 1.108   25 May 1995 20:43:40   amontalv
  393. '' Checked in for Greg Lutz.  He commented out code that validated path in order
  394. '' to get long file names.
  395. '' 
  396. ''    Rev 1.107   19 May 1995 19:06:00   glutz
  397. '' Added some comments to UNC functions
  398. '' 
  399. ''    Rev 1.106   18 May 1995 12:21:20   tveerapp
  400. '' Added SetTheComponentsDir stub.MZ to fill in contents.
  401. '' 
  402. ''    Rev 1.105   18 May 1995 10:37:46   jdonohue
  403. '' Fixed logic for AddToBillboardList with multiple resource DLLs
  404. '' 
  405. ''    Rev 1.104   17 May 1995 17:53:50   mzgripce
  406. '' Change Reg_SetLicenserSupport() and Reg_SetLicenseSelected() to eliminate
  407. '' Licenser support 
  408. '' 
  409. ''    Rev 1.103   16 May 1995 17:13:06   amontalv
  410. '' Had to change the name of the dialog proc to _FNameOrgDlgProc@16.
  411. '' 
  412. ''    Rev 1.102   16 May 1995 17:07:56   glutz
  413. '' Split all automation functions out to automate.lss
  414. '' 
  415. ''    Rev 1.101   16 May 1995 09:19:52   glutz
  416. '' Added wrappers for
  417. '' FAddToDriveFreeSpaceList
  418. '' FIsUnvalidatedUNCPath
  419. '' FisValidUNCPath
  420. '' Added SUB Lot_SplitUNCPath
  421. '' Added functions'
  422. '' Lot_IsUnvalidatedUNCPath
  423. '' Lot_IsValidUNCPath
  424. '' Modified
  425. '' IsPathWritable
  426. '' ValidatePath
  427. '' SelectDriveCombo
  428. '' 
  429. ''    Rev 1.100   15 May 1995 11:19:18   jdonohue
  430. '' Call SetUpApi in initialize function
  431. '' 
  432. ''    Rev 1.99   11 May 1995 16:55:58   tveerapp
  433. '' Added a global variable gLogFile$ . Commented out the calls
  434. '' to WriteToLogFile - this is no longer a function.
  435. '' 
  436. ''    Rev 1.98   03 May 1995 18:17:40   mzgripce
  437. '' fix the syntax errors 
  438. '' 
  439. ''    Rev 1.97   03 May 1995 11:45:56   tveerapp
  440. '' Fixed the cfbuild-c2build merge.
  441. '' 
  442. ''    Rev 1.96   02 May 1995 17:51:08   mzgripce
  443. '' fixed some syntax errors in new features 
  444. '' 
  445. ''    Rev 1.95   02 May 1995 12:53:34   cmoy
  446. '' Merged c2 into cf build
  447. '' 
  448. ''    Rev 1.88   27 Apr 1995 16:48:10   mheerman
  449. '' Removed debug print from help case.
  450. ''    Rev 1.92F  26 Apr 1995 17:33:42   mzgripce
  451. '' replace TwoMainDirFlag with ExtraProdDirsNum and change the 
  452. '' subroutine and function name that process it.
  453. '' 
  454. ''    Rev 1.91F  25 Apr 1995 17:10:46   mzgripce
  455. '' add a new field: TwoMainDirFlag to ProdInfo Structure
  456. '' add SUBROUTINE Reg_SetTwoMainDirFlag and FUNCTION Reg_GetProdSupportForTwo-
  457. '' MainDir()
  458. '' change Reg_RegisterProductNames to set TwoMainDirFlag to 0
  459. '' 
  460. ''    Rev 1.87   14 Apr 1995 16:03:16   amontalv
  461. '' Deleted code that took care of final null in nul terminated strings.
  462. ''    Rev 1.90F  25 Apr 1995 11:45:20   tveerapp
  463. '' Added Lot_AutoCustomizeShare().
  464. '' 
  465. ''    Rev 1.86   10 Apr 1995 17:58:42   amontalv
  466. '' Made changes to functions and to some callback routines.
  467. ''    Rev 1.89F  24 Apr 1995 14:02:08   tveerapp
  468. '' Fixed Lot_AutoInstallCustomize.
  469. '' 
  470. ''    Rev 1.88   19 Apr 1995 14:38:24   jdonohue
  471. '' Changed SYM_CUIDLL$ from DLL name to list of DLLs in PopupMod..Dialog and 
  472. '' AddToBillboardList
  473. '' 
  474. ''    Rev 1.87F  13 Apr 1995 10:46:36   mzgripce
  475. '' Add Share32 field to ProdInfo struct
  476. '' Change Reg_RegiserProductNames to set the default of Share32 to 0
  477. '' added: Lot_AreShare32ToolsSupported(); Lot_GetShare32ToolsSize()
  478. '' Reg_GetProdSupportForShare32(); Reg_SetShare32Flag()
  479. '' 
  480. ''    Rev 1.86F  13 Apr 1995 19:00:20   tveerapp
  481. '' Added Lot_AutoInstallCustomize.
  482. '' 
  483. ''    Rev 1.85   05 Apr 1995 19:53:52   amontalv
  484. '' Porting to 32 bit.
  485. '' 
  486. ''    Rev 1.84   31 Mar 1995 18:47:52   amontalv
  487. '' Had to add aliases to function names for LotusScript to find them in DLLs
  488. '' 
  489. ''    Rev 1.83   20 Jan 1995 16:42:48   tveerapp
  490. '' 
  491. '' Fixed spr# ccol2nsl4. In autogetsetlicenser,moved the if licselected% to the right place.
  492. '' 
  493. ''    Rev 1.82   17 Jan 1995 16:45:12   tveerapp
  494. '' 
  495. '' Replaced existing error message for AutoCheckForspace.
  496. '' Fixes spr# TVEN2NBNEP.
  497. '' 
  498. ''    Rev 1.81   14 Jan 1995 15:58:54   jplump
  499. '' 
  500. '' Removed else case in Lot_AutoSuiteAppSelect. Before this routine
  501. '' is called in main, there is a check to see if the product is a
  502. '' SUITE; if it is not, this routine is not called. Therefore, the
  503. '' else case (if not Suite) in this routine won't happen. If the logic
  504. '' in main changes not to check for Suite, then the else case should
  505. '' not post an error for the user, but return to main without looking
  506. '' for Suite Applications.
  507. '' 
  508. ''    Rev 1.80   13 Jan 1995 11:28:18   jplump
  509. '' 
  510. '' In Lot_AutoGetInstallType, added option 4 (node). This option really doesn't
  511. '' do anything if the user has already done a server install and is doing a 
  512. '' legitimate node install. However, if the user has not done a server install
  513. '' and puts 4 as the install type, an error will be displayed. This error tells
  514. '' the user that he must to a server install first.
  515. '' 
  516. '' 
  517. '' 
  518. ''    Rev 1.79   11 Jan 1995 10:28:24   tveerapp
  519. '' 
  520. '' Fixed the logic in the AutoNodeoptions processing. Changed the OR to AND.
  521. '' The error should be signaled only if it is neither a 1 nor a 0.
  522. '' 
  523. ''    Rev 1.78   10 Jan 1995 19:04:38   jplump
  524. '' 
  525. '' When processing values from RSP file in automation,
  526. '' added check for missing value before casting string
  527. '' to integer. This is a workaround for a bug in
  528. '' LotusScript. An empty string should be a 0 when 
  529. '' cast to an integer (CINT), but it is not.
  530. '' SPR JMOY2N7QVK
  531. '' 
  532. ''    Rev 1.77   09 Jan 1995 16:50:32   tveerapp
  533. '' 
  534. '' Removed redundant code from Lot_CheckRSPPath as a result of the preious change(1).
  535. '' 
  536. ''    Rev 1.76   09 Jan 1995 16:48:04   tveerapp
  537. '' 
  538. '' Two changes:
  539. '' 1. Fixed the default for Lot_CheckRSPPath's return value to be "".
  540. '' 2. Fixed spr# JHOH2N7PHF
  541. '' 
  542. ''    Rev 1.75   07 Jan 1995 18:26:02   jplump
  543. '' 
  544. '' Made changes to keyword and section processing in Lot_Auto???
  545. '' functions to reflect changes in auto.rsp due to DOC review.
  546. '' 
  547. '' 
  548. ''    Rev 1.74   07 Jan 1995 15:56:20   jplump
  549. '' 
  550. '' In Lot_AutoCheckRSPPath fixed problem with function
  551. '' returning and invalid path. Calling functions should
  552. '' expect an empty string as a return value if the path
  553. '' is invalid.
  554. '' 
  555. ''    Rev 1.73   30 Dec 1994 14:12:28   jplump
  556. '' 
  557. '' Removed section name from error case in Select Applications processing
  558. '' 
  559. ''    Rev 1.72   30 Dec 1994 14:00:40   jplump
  560. '' 
  561. '' Added Lot_Auto_CheckRSPPath to validate paths in the response file.
  562. '' If the user does not supply a path in the rsp file, he\she will get
  563. '' this message: "Automated Install Error. Response File: One or more
  564. '' product directory paths are invalid in section:      " If the user
  565. '' supplies a path that is invalid, the invalid path message will be
  566. '' displayed first, and then Automated Install Error.
  567. '' 
  568. '' 
  569. ''    Rev 1.71   23 Dec 1994 18:34:30   jplump
  570. '' 
  571. '' Changed automation errors to be resourced errors.
  572. '' 
  573. ''    Rev 1.70   23 Dec 1994 14:07:44   jplump
  574. '' 
  575. '' Added Lot_AutoGetSetLicenserInfo
  576. '' Removed print statements
  577. '' Enhanced AutoDebug function
  578. '' 
  579. '' 
  580. ''    Rev 1.69   22 Dec 1994 15:09:08   tveerapp
  581. '' 
  582. '' Added Error Msg to AutoCheckForSpace
  583. '' 
  584. ''    Rev 1.68   22 Dec 1994 14:27:16   tveerapp
  585. '' 
  586. '' Fixed a type mismatch
  587. '' 
  588. ''    Rev 1.67   22 Dec 1994 14:22:42   tveerapp
  589. '' 
  590. '' Modified Lot_AutoGetProductDestDir.. for suite.
  591. '' 
  592. ''    Rev 1.66   22 Dec 1994 13:28:26   tveerapp
  593. '' 
  594. '' Fixed Lot_AutoSuiteAppSelect function.
  595. '' 
  596. ''    Rev 1.65   22 Dec 1994 11:38:52   tveerapp
  597. '' 
  598. '' Changed Lot_Check path to ValidatePath in Lot_AutoGetProductDestDir.
  599. '' 
  600. ''    Rev 1.64   21 Dec 1994 17:18:34   tveerapp
  601. '' 
  602. '' Fixed a type mismatch
  603. '' 
  604. ''    Rev 1.63   21 Dec 1994 17:08:22   tveerapp
  605. '' 
  606. '' Added Lot_AutoProcessNodeOptions.
  607. '' 
  608. ''    Rev 1.62   21 Dec 1994 14:58:44   tveerapp
  609. '' 
  610. '' Removed an erroneous end case
  611. '' 
  612. ''    Rev 1.61   21 Dec 1994 14:56:12   tveerapp
  613. '' 
  614. '' Fixed a typo
  615. '' 
  616. ''    Rev 1.60   21 Dec 1994 13:10:00   tveerapp
  617. '' 
  618. '' Added a missing end if and Next
  619. '' 
  620. ''    Rev 1.59   21 Dec 1994 13:03:12   tveerapp
  621. '' 
  622. '' Added Lot_AutoSuiteAppSel function. Added Error messages that need to be resourced!!
  623. '' Modified Lot-AutoGetSIzeofInstall.
  624. '' 
  625. ''    Rev 1.58   21 Dec 1994 11:54:48   tveerapp
  626. '' 
  627. '' Modified Lot_AutoGetBase function. It returns the base directory instead of setting it.
  628. '' 
  629. ''    Rev 1.57   12 Dec 1994 11:36:34   tveerapp
  630. '' 
  631. '' Incorporated jill's changes to Lot_AutoGetProductDestinationDir and
  632. '' Lot_AutoWriteOutDebugFile. Remmed out the existing functions. These
  633. '' can be removed after verfication with jill.
  634. '' 
  635. ''    Rev 1.56   12 Dec 1994 11:05:08   mzgripce
  636. '' 
  637. '' Added 4 funcs:Lot_AutoChangeLotusAppDir(), Lot_AutoConsolidateLotusAppDir()
  638. '' Lot_AutoConsolidateMoveCopy(), Lot_AutoIsThisNetLotusApp() 
  639. '' 
  640. ''    Rev 1.55   08 Dec 1994 20:10:34   jplump
  641. '' Added Lot_AutoWriteOutDebugFile
  642. '' Fixed Lot_AutoGetProductDestDirSymbol to use prodno%
  643. '' 
  644. ''    Rev 1.54   06 Dec 1994 17:21:00   tveerapp
  645. '' 
  646. '' Modified Lot_GetKeyValFromResponseFile to set gAutoFile$ to thw
  647. '' value of the symbol processed by shell in the command line.
  648. '' 
  649. ''    Rev 1.53   06 Dec 1994 10:23:54   tveerapp
  650. '' 
  651. '' Added Lot_AutoCinfigureAutoExec function and AutoInstallReboot.
  652. '' 
  653. ''    Rev 1.52   05 Dec 1994 15:09:52   jplump
  654. '' Added Lot_AutoGetUserInfo
  655. '' 
  656. ''    Rev 1.51   02 Dec 1994 15:56:56   cmoy
  657. '' 
  658. '' Merged automation files
  659. '' 
  660. ''    Rev 1.50   02 Dec 1994 15:10:42   cmoy
  661. '' 
  662. ''    Rev 1.11   01 Dec 1994 17:30:54   tveerapp
  663. '' 
  664. '' Added The AutoCheckSpace function.
  665. '' 
  666. ''    Rev 1.10   01 Dec 1994 10:22:16   jplump
  667. '' Added character checking to Lot_AutoGetProgramGroup
  668. '' 
  669. '' 
  670. '' 
  671. ''    Rev 1.9   30 Nov 1994 10:19:56   tveerapp
  672. '' Modified RegisterCallback function to register a callback only when not
  673. '' in the automation mode.
  674. '' 
  675. ''    Rev 1.8   29 Nov 1994 14:27:22   tveerapp
  676. '' Added a check to Lot_GetKeyValFromResponseFile.
  677. '' 
  678. ''    Rev 1.7   29 Nov 1994 12:53:34   tveerapp
  679. '' 
  680. '' Added i%, nProds to the declartions.D
  681. '' 
  682. ''    Rev 1.6   29 Nov 1994 12:45:54   tveerapp
  683. '' Modified Lot_AutoGetSizeOFinstall function. It returns an integer.
  684. '' 
  685. ''    Rev 1.5   29 Nov 1994 11:42:18   jplump
  686. '' 
  687. '' Added functions:  Lot_AutoGetSizeOfInstall & 
  688. '' Lot_AutoGetProgramGroup.
  689. '' 
  690. ''    Rev 1.4   23 Nov 1994 16:27:40   tveerapp
  691. '' 
  692. '' Added Lot_AutoGetInstallType function used in main.
  693. '' 
  694. ''    Rev 1.3   23 Nov 1994 15:22:02   tveerapp
  695. '' 
  696. '' Modified PopupModal for Automation.
  697. '' 
  698. ''    Rev 1.2   23 Nov 1994 14:02:02   jplump
  699. '' Added Lot_AutoGetBaseDirSymbol
  700. '' 
  701. ''    Rev 1.1   22 Nov 1994 16:34:40   jplump
  702. '' 
  703. '' Added INIT symbol processor
  704. '' 
  705. ''    Rev 1.0   22 Nov 1994 16:26:10   jplump
  706. '' Initial Revision
  707. ''==========
  708. '' 
  709. ''    Rev 1.47   02 Nov 1994 18:33:34   jplump
  710. '' Resourced error message in ModifyAutoexec()
  711. '' SID_ERR_AUTOEXEC_NOT_COPIED
  712. '' 
  713. '' Jill Salter Plump
  714. '' 
  715. '' 
  716. ''    Rev 1.46   03 Oct 1994 11:12:12   tveerapp
  717. '' Fixed spr# 1023351. Makepath checks for 13 chars. and a \.
  718. '' If valid accepts it else returns an empty string.
  719. '' 
  720. ''    Rev 1.45   27 Sep 1994 13:05:56   cmoy
  721. '' Added constants needed for rebooting and restarting
  722. '' 
  723. ''    Rev 1.44   22 Sep 1994 09:35:42   mzgripce
  724. '' Add CDOptDefaultSelected in PRODINFO structure
  725. '' Write: SUB Reg_ReSetCDOptionSelected
  726. ''  SUB Reg_ReSetCDOptionSelectedToDefault
  727. ''  SUB Reg_ReSetAllOptSelToDefaults
  728. '' all functions for cd settings checking and change the funcs that populates 
  729. '' 
  730. ''    Rev 1.43   02 Aug 1994 11:17:58   mzgripce
  731. '' To fix Node Options bug I commented out the call to the sub
  732. '' Reg_ReSetAllNodeOptsToDefaults in the function 
  733. '' Lot_AreAnyNodeOptAvailToSrv()
  734. '' 
  735. ''    Rev 1.42   21 Jul 1994 18:09:34   thangv
  736. '' Modified return value of IsNotesinpath to be 1  if it is not in
  737. '' lotus.ini. (this will reduce the ocuurences of autoexec change dialog
  738. '' showing up).
  739. '' 
  740. ''    Rev 1.41   13 Jun 1994 17:20:12   cmoy
  741. '' 
  742. '' ADDED GETBOOTDRIVE FUNCTIONALITY
  743. '' 
  744. ''    Rev 1.40   08 Jun 1994 17:05:12   mmeth
  745. '' Fixed PopulateCINSTALLLIST.  The bug in here was that we weren't writing ov
  746. '' previous versions of cinstall.ini correctly. gNCINSTALL set to -1 instead o
  747. '' 
  748. ''    Rev 1.39   05 Jun 1994 20:21:36   ptilton
  749. '' Added Global Subroutines for Setting OracleHomeDir & NotesDataDir
  750. '' Symbols.  Moved functions for determining values for symbols from 
  751. '' SHARE.LSS
  752. '' 
  753. ''    Rev 1.38   02 Jun 1994 12:35:32   thangv
  754. '' 
  755. '' Added TrimNetlotusapp function.
  756. '' 
  757. ''    Rev 1.37   31 May 1994 14:04:54   thangv
  758. '' 
  759. '' Added Showwaitcursor and restorecursor foe fine check in CheckforSpace.
  760. '' 
  761. ''    Rev 1.36   31 May 1994 13:40:04   mmeth
  762. '' Added Function Calls for Suite to handle previous versions
  763. '' 
  764. ''    Rev 1.35   26 May 1994 07:25:00   mmeth
  765. '' In CheckForSpace the variable notused1$ was refernced, but not declared.
  766. '' 
  767. ''    Rev 1.34   25 May 1994 17:10:12   cmoy
  768. '' 
  769. '' put up a please wait dialog in CheckForSpace
  770. '' 
  771. ''    Rev 1.33   24 May 1994 16:54:16   thangv
  772. '' Set the tab to 50 from 75 in CheckForSpace.
  773. '' 
  774. ''    Rev 1.32   24 May 1994 15:47:18   mmeth
  775. '' Fixed Performance problem having to do with reading and writing CINSTALL.IN
  776. '' 
  777. ''    Rev 1.31   23 May 1994 14:50:02   mzgripce
  778. '' fix a bug in IsThe Featureinstalled 
  779. '' 
  780. ''    Rev 1.30   20 May 1994 17:24:44   mmeth
  781. '' Modified Lot_IsTheFeatureInstalled. It uses a list (CINSTALL) and
  782. '' works faster.
  783. '' 
  784. ''    Rev 1.29   12 May 1994 11:20:24   mmeth
  785. '' Adding Icons for Lic and Install and using DoMsgBox instead of MessageBox
  786. '' 
  787. ''    Rev 1.28   29 Apr 1994 16:36:36   mzgripce
  788. '' 
  789. '' fixed spr # 28650
  790. '' 
  791. ''    Rev 1.27   28 Apr 1994 13:29:38   mzgripce
  792. '' 
  793. '' added Lot_IsDestVerNewerOrEqual()
  794. '' 
  795. ''    Rev 1.26   21 Apr 1994 15:32:40   mzgripce
  796. '' 
  797. '' implement the correct err message for too long path(SID_ERR_PATHLEN_...)
  798. '' 
  799. ''    Rev 1.25   20 Apr 1994 16:45:38   thangv
  800. '' Modified Lot_AreAnyNodeOptionsAvailToSrv function to check
  801. '' for any node options not being in the copylist.
  802. '' 
  803. ''    Rev 1.24   20 Apr 1994 16:23:20   mzgripce
  804. '' 
  805. '' Reject paths that are too long.
  806. '' 
  807. ''    Rev 1.23   19 Apr 1994 10:28:32   thangv
  808. '' Added FremoveSymbol(IDC_TEXT) in Popupmodal function
  809. '' when exit button is selected.
  810. '' 
  811. ''    Rev 1.22   13 Apr 1994 09:55:28   cmoy
  812. '' 
  813. '' Added SHAREEXE and Notes as fields in Registration Database
  814. '' Added SUBS:
  815. '' Reg_SetSHAREEXESupport
  816. '' Reg_SetNotesSupport
  817. '' Added FUNCTIONS:
  818. '' Reg_GetSHAREEXESupport
  819. '' Reg_GetNotesSupport
  820. '' GetNotesPathfromLotusIni
  821. '' IsNotesInPath
  822. '' IsShareInAUTOEXEC
  823. '' ModifyAutoexec
  824. '' GetBootDrive
  825. '' Added Constants
  826. '' MANotes
  827. '' MAShare
  828. '' 
  829. ''    Rev 1.21   07 Apr 1994 16:41:12   mmeth
  830. '' changed return code for EXECUTE statement to a public variable
  831. '' 
  832. ''    Rev 1.20   07 Apr 1994 12:38:20   mmeth
  833. '' Modified DOEXEC to EXECUTE.
  834. '' 
  835. ''    Rev 1.19   06 Apr 1994 16:28:06   mmeth
  836. '' Added a list gEXTRA.  This list gets initialized with an etra 200000
  837. '' bytes for the Windows drive.  This can be modified by the product groups if
  838. '' necessary. 
  839. '' 
  840. ''    Rev 1.18   04 Apr 1994 18:02:18   mmeth
  841. '' Took out share.lss depednancies for those products that don't need it.
  842. '' 
  843. ''    Rev 1.17   23 Mar 1994 10:11:08   mmeth
  844. '' WhereIsFeature... fixed for SmartSuiteNode case &
  845. '' SaveFeatureInstalled... was fixedso it would write without adding extra "\"
  846. '' 
  847. ''    Rev 1.16   23 Mar 1994 09:17:52   mzgripce
  848. '' add LOOKONNETLOTUSAPP to whereIsFeature 
  849. '' 
  850. ''    Rev 1.15   18 Mar 1994 18:30:50   mzgripce
  851. '' change Lot_WhereIsFeature and save Destination Directories for suit server
  852. '' 
  853. ''    Rev 1.14   11 Mar 1994 16:58:56   thangv
  854. '' Added the Dist field in the Registration database
  855. '' Added The Reg_Set.. and Reg_GetProd.. functions for dist.
  856. '' 
  857. ''    Rev 1.13   10 Mar 1994 17:24:54   mzgripce
  858. '' add Lot_InitializeWinWinsysSym subroutine
  859. '' 
  860. ''    Rev 1.12   01 Mar 1994 17:08:30   mzgripce
  861. '' CALL FIsKeywordInCopyList into Lot_SaveNodeOptionsInInstallIni
  862. '' 
  863. ''    Rev 1.11   01 Mar 1994 12:13:14   mzgripce
  864. '' added NodeOptDefaultSelected to PRODINFO type def
  865. '' change: Reg_RegisterProductNames and Reg_SetNodeOptionSelected
  866. '' added: Reg_IsNodeOptionDefaultSelected
  867. ''        Reg_ReSetNodeOptionSelectedToDefault
  868. ''        Reg_ReSetNodeOptionSelected and
  869. ''        Reg_ReSetAllNodeOptsSelToDefaults
  870. '' 
  871. ''    Rev 1.10   24 Feb 1994 12:56:12   tingmann
  872. '' add lot_lcbsettabs
  873. '' 
  874. ''    Rev 1.9   23 Feb 1994 18:14:30   mzgripce
  875. '' fix Lot_SaveTheNodeOptionsInInstallIni() (replace"1" with STR(1))
  876. '' 
  877. ''    Rev 1.8   22 Feb 1994 17:04:24   mzgripce
  878. '' add Lot_AreAnyNodeOptAvailToSrv()
  879. '' 
  880. ''    Rev 1.7   17 Feb 1994 10:24:46   mmeth
  881. '' Added Reg_SetAllowUserToChoseInSMartSUite
  882. '' 
  883. ''    Rev 1.6   16 Feb 1994 14:40:06   tingmann
  884. '' add reg_getproductname,reg_getuiinorout, lot_lcbsetsel
  885. '' 
  886. ''    Rev 1.5   16 Feb 1994 12:13:46   tingmann
  887. '' fix END statement problem when running from DOEXEC (in QUIT sub)
  888. '' 
  889. ''    Rev 1.4   15 Feb 1994 15:01:38   mmeth
  890. '' added pvcs line for toolkit.lss &
  891. ''
  892. ''   Creation Date: Wednesday January 5, 1994
  893. ''
  894. ''   Copyright Lotus Development Corporation, (c) 1994
  895. ''
  896. ''
  897. ''   Description:
  898. ''      
  899. ''
  900. ''   Additional authors: MZ
  901. ''
  902. ''   Change History:
  903. ''----------------------------------------------------------------------
  904. ''   Date     Vers. Pgmr  SPR#  Change
  905. ''----------------------------------------------------------------------
  906. '' 02-16-94   0032  MZ         Added Lot_AreAnyNodeOptAvailToSrv()
  907. ''!
  908. '' 02-16-94   0031  TQI           Fix exit problem when calling QUIT during DOEXEC
  909. '' 02-14-94   0030  MZ          Added Lot_IsAnyNodeOptAvailToNode() and
  910. ''                              Lot_AreNodeOptAvailToNodeForProd()
  911. ''                              Lot_GetNumOfNodeOptAvailToNodeForProd()
  912. '' 02-11-94   0029  MZ          Added Lot_SaveTheNodeOptionsInInstallIni(),
  913. ''                              Lot_GetLastNodeOptNumber() and
  914. ''                              Lot_IsTheNodeOptionsAvailToNode() functions
  915. '' 02-07-94   0028  MZ          move Lot_SaveFeaturesInstaledInInstallIni()
  916. ''                              and Lot_GetLastFeatureNumber() from share.lss
  917. '' 02-06-94   0027  MMETH       fixed Lot_Toggle... and MsgBox-> MessageB
  918. '' 02-04-94   0026  MMETH       Added defaults for Reg DB.
  919. '' 02-03-94   0025  MMETH       added Lot_WhereIsFeature also moved 
  920. ''                              Lot_IstheFeatureInstall from toolkit.lss
  921. '' 02-01-94   0024  MZ          ADDED Lot_GetGroupName and set
  922. ''                              Prods(gCurrNumOfProds%).ProgManagerGroup="Lotus Applications"
  923. '' 02-01-94   0024  MMETH       INSTALL_SOURCE still coming up empty.
  924. '' 01-31-94   0023  MMETH       Cleaned up CallProductFunctions and Back
  925. '' 01-30-94   0022  MMETH       Removed CreateCOuntDir from remmed out code
  926. '' 01-28-94   0021  MZ          Add:Reg_SetLicenseSelected
  927. ''                                  Reg_IsLicenseSelected
  928. ''                                  Reg_SetCountDirectory
  929. ''                                  Reg_GetCountDirectory
  930. ''                                  Reg_SetBillboardNumber
  931. ''                                  Reg_GetBillboardNumber
  932. ''                              Change Reg_RegisterProductNames to set the 
  933. ''                              BillboardNumber to 0
  934. '' 01-28-94   0022  MMETH       Fixed CallProducts for "BACK"
  935. '' 01-28-94   0021  DND         Added Reg_GetSystemFileSize and
  936. ''                              Reg_SetSystemFileSize.
  937. '' 01-27-94   0020  DND         Lot_GetChapterValStr returns empty
  938. ''                              string if chapter is not found.
  939. '' 01-25-94   0019  DND         Move SetRestartDir, RestartListEmpty,
  940. ''                              and ExitExecRestart from setupapi.
  941. '' 01-25-94   0018  MMETH       Added Lot_TrimEndSlash
  942. '' 01-24-94   0017  MMETH       Fix GetTheRealProdDir
  943. '' 01-24-94   0016  TQI         Capture function returns (lsi36)
  944. '' 01-24-94   0015  MMETH       Move GetTheRealProd from share.lss
  945. ''                              added prodno% parm, and modified implememntaion
  946. '' 01-21-94   0014  MMETH       Added Parms to Lot_CallProducts
  947. '' 01-20-94   0013  DND         CheckForSpace no longer pops modeless
  948. '' 01-20-94   0012  MZ          Modify Reg_SetSelectedInstallType() to set to 
  949. ''                              complete if custom and/or laptop is not a
  950. ''                              valid choice for the product.
  951. '' 01-19-94   0011  DND         Modified the GetFirstDrive functions so
  952. ''                              they now return with the default dir.
  953. ''                              Made the AllDrive function more effecient.
  954. '' 01-19-94   0010  MMETH       Changed CallProd family to use Reg_GetProductAcronym
  955. '' 01-19-94   0009  MZ          Change TRUE/FALSE to 1/0 in Reg_* SUB/FUNCs
  956. '' 01-19-94   0009  MMeth       Use SYM_UPDATELIST$. 
  957. ''                              Added Reg_GetNumberOfProducts.
  958. '' 01-19-94   0008  DND         Lot_Get/SetCurrentProduct saves and returns
  959. ''                              an integer. This makes life much easier
  960. ''                              for toolkit. Changed 
  961. ''                              Reg_SetSelectedInstallTypes to
  962. ''                              Reg_SetSelectedInstallType. Fixed 
  963. ''                              SelectDriveCombo to accept a path.
  964. ''                              Lot_ExtractDriveLetter returns lower case.
  965. '' 01-19-94   0008  TQI         Use doexec instead of execute
  966. '' 01-18-94   0007  MZ          move Lot_CleanPath() to setupapi.lss
  967. '' 01-18-94   0006  MZ          Put in the Product registration database
  968. '' 01-18-94   0005  DND         Added Lot_CleanPath
  969. '' 01-12-94   0004  MMETH       Changed Return code of CallProd to string
  970. '' 01-12-94   0003  mmeth            Lot_CallProductFunctions (func_name$, always%, parms$)
  971. '' 01-12-94   0002  tqi         option declare
  972. '' 01-10-94   0001  MZ          Make all symbols Constants and put them
  973. ''                              in GLOBALS.LSS
  974. '' 01-05-94   0000  DND         Initial checkin
  975. ''----------------------------------------------------------------------
  976. ''
  977. ''**********************************************************************
  978.  
  979. 'USE "SETUPAPI"
  980. USE "START"
  981. USE "REGISTER"
  982. OPTION DECLARE
  983. '************ User messages
  984.  
  985. PUBLIC CONST WM_COMMAND        = 273
  986. PUBLIC CONST WM_USER           = 1024
  987. PUBLIC CONST UM_PAINTMODELESS  = (WM_USER+1000)
  988. PUBLIC CONST UM_REBOOTFLAG     = (WM_USER+503)
  989. PUBLIC CONST UM_RESTARTWINDOWS = (WM_USER+504)
  990.  
  991.  
  992. '** Return codes for drive type
  993. PUBLIC CONST DRIVE_REMOVABLE = 2
  994. PUBLIC CONST DRIVE_FIXED     = 3
  995. PUBLIC CONST DRIVE_REMOTE    = 4
  996.  
  997. '** Function return codes
  998. PUBLIC CONST SUCCESS = 1
  999. PUBLIC CONST FAILURE = 0
  1000. PUBLIC CONST MANotes = 1   '** used in ModifyAutoexec
  1001. PUBLIC CONST MAShare = 2   '** used in ModifyAutoexec
  1002.  
  1003. '** These numbers must match those in lcomstf\sections.h of lcomstf.dll!!
  1004. PUBLIC CONST F_NOTHING    = 0
  1005. PUBLIC CONST F_CHAPTER    = 1
  1006. PUBLIC CONST F_NAME       = 2
  1007. PUBLIC CONST F_INOROUT    = 4
  1008. PUBLIC CONST F_DISPLAY    = 8
  1009. PUBLIC CONST F_COMPLETE   = 16
  1010. PUBLIC CONST F_LAPTOP     = 32
  1011. PUBLIC CONST F_CUSTOM     = 64
  1012. PUBLIC CONST F_TIPS       = 128
  1013. PUBLIC CONST F_HELP       = 256
  1014. PUBLIC CONST F_DESTDIR    = 512
  1015. PUBLIC CONST F_BITMAP     = 1024
  1016. PUBLIC CONST F_EXCEPTION  = 2048
  1017. PUBLIC CONST F_SHARE      = 4096
  1018. PUBLIC CONST F_KEYWORD    = 8192
  1019. PUBLIC CONST F_DESTDIRSYM = 16384
  1020.  
  1021. PUBLIC CONST RT_BITMAP  = 2     'This should be a MAKEINTRESOURCE(2) really
  1022. PUBLIC CONST RT_DIALOG  = 5     'This should be a MAKEINTRESOURCE(5) really
  1023. PUBLIC CONST RT_STRING  = 6     'This should be a MAKEINTRESOURCE(6) really
  1024.  
  1025. 'The decorated name for the generic dialog procedure in dlgproc.c  JMD
  1026. PUBLIC CONST FNAMEORGDLGPROC$="_FNameOrgDlgProc@16"
  1027.  
  1028. 'needed in callbacks
  1029. PUBLIC CONST MAX_NO_DRIVECOMBOS = 4
  1030.  
  1031. '*****
  1032. 'NEEDED FOR THE ARRAY CINSTALL
  1033. DECLARE SUB PopulateCINSTALLLIST
  1034. DIM CINSTALL LIST AS STRING
  1035. DIM gNCINSTALL%
  1036.  
  1037. 'NEEDED FOR THE ARRAY CINSTNODE
  1038. DECLARE SUB PopulateCINSTNODELIST
  1039. DIM CINSTNODE LIST AS STRING
  1040. DIM gNCINSTNODE%
  1041.  
  1042. %rem
  1043.  Moved to register.lss
  1044. '******************** Product Registration  struc, array and count *********
  1045. TYPE PRODINFO
  1046.    Acronym                    AS STRING
  1047.    Name                       AS STRING
  1048.    Complete                   AS INTEGER
  1049.    Custom                     AS INTEGER
  1050.    Laptop                     AS INTEGER
  1051.    SelectedType               AS STRING
  1052.    UIInOrOut                  AS INTEGER
  1053.    AllowUserToPickInSuite     AS INTEGER
  1054.    FullSize                   AS LONG
  1055.    MinSize                    AS LONG
  1056.    Share                      AS INTEGER
  1057.    Share32                    AS INTEGER
  1058.    DataLens                   AS INTEGER
  1059.    SQL                        AS INTEGER
  1060.    Paradox                    AS INTEGER
  1061.    CDOpt                      AS STRING
  1062.    CDOptSelected              AS STRING
  1063.    CDOptDefaultSelected       AS STRING
  1064.    NodeOpt                    AS STRING
  1065.    NodeOptSelected            AS STRING
  1066.    NodeOptDefaultSelected     AS STRING
  1067.    Srv                        AS INTEGER
  1068.    Dist                       AS INTEGER
  1069.    ExtraProdDirsNum           AS INTEGER
  1070.    License                    AS INTEGER
  1071.    LicenseSelected            AS INTEGER
  1072.    CountDirectory             AS STRING
  1073.    ATM                        AS INTEGER
  1074.    DirSymList                 AS STRING         'Should be populated in Init
  1075.    ProgManagerGroup           AS STRING
  1076.     ProgFolder                                              AS STRING
  1077.    SystemFileSize             AS LONG
  1078.    BillboardNumber            AS INTEGER
  1079.    SHAREEXE                   AS INTEGER
  1080.    Notes                      AS INTEGER
  1081.    PreviousVersion            AS STRING      'This is a string for future purposes
  1082.    MoreDirsCBName             AS STRING
  1083.    MoreDirsDlgID              AS INTEGER
  1084.    MoreDirsHlpID              AS LONG
  1085.    ObsoleteFiles              AS INTEGER      'This is can be a string for future enhancements
  1086. END TYPE
  1087.  
  1088. DIM Prods(gMaxNumOfProds) AS PRODINFO  
  1089. DIM gCurrNumOfProds%                      '** Number of products
  1090. DIM gCurrentProduct%                      '** The current product
  1091. %endrem
  1092.  
  1093. '******************** Lotus DLL interface **************************
  1094.  
  1095. DECLARE PUBLIC FUNCTION FIsKeywordInCopyList LIB "lcomstf.dll" ALIAS "_FIsKeywordInCopyList@4" (ByVal szKeyword$) AS LONG
  1096. DECLARE PUBLIC FUNCTION FGetChapterFromKeyword LIB "lcomstf.dll" ALIAS "_FGetChapterFromKeyword@12" (ByVal szKeyword$, ByVal szChptname$, ByVal cbChptsize&) AS LONG
  1097. DECLARE PUBLIC FUNCTION FRemoveDir LIB "lcomstf.dll" ALIAS "_FRemoveDir@4" (ByVal szDir$) AS LONG
  1098. DECLARE PUBLIC FUNCTION FOpenInf LIB "lcomstf.dll" ALIAS "_FOpenInf@12" (ByVal szFile$,ByVal fCheck&,ByVal fCheckSyms&) AS LONG
  1099. DECLARE PUBLIC FUNCTION LcbGetChapterCost LIB "lcomstf.dll" ALIAS "_LcbGetChapterCost@16" (ByVal szchapter$,ByVal szextra$,ByVal szcost$, ByVal szneed$) AS LONG
  1100. DECLARE PUBLIC FUNCTION CbGetInfSectionKeyField LIB "lcomstf.dll" ALIAS "_CbGetInfSectionKeyField@20" (ByVal szSect$, ByVal szKey$, ByVal iField&, ByVal szBuf$, ByVal cbBuf&) AS LONG
  1101. DECLARE PUBLIC FUNCTION FMakeListInfSectionField LIB "lcomstf.dll" ALIAS "_FMakeListInfSectionField@12" (ByVal szSym$, ByVal szSect$, ByVal iField&) AS LONG
  1102. DECLARE PUBLIC FUNCTION FSetSymbolToListOfInfKeys LIB "lcomstf.dll" ALIAS "_FSetSymbolToListOfInfKeys@12" (ByVal szSym$, ByVal szSect$, ByVal fNulls&) AS LONG
  1103. DECLARE PUBLIC FUNCTION FAddSectionFilesToCopyList LIB "lcomstf.dll" ALIAS "_FAddSectionFilesToCopyList@12" (ByVal szSect$, ByVal szSrc$, ByVal szDest$) AS LONG
  1104. DECLARE PUBLIC FUNCTION FAddSectionKeyFileToCopyList LIB "lcomstf.dll" ALIAS "_FAddSectionKeyFileToCopyList@16" (ByVal szSect$, ByVal szKey$, ByVal szSrc$, ByVal szDest$) AS LONG
  1105. DECLARE PUBLIC FUNCTION FDumpCopyListToFile LIB "lcomstf.dll" ALIAS "_FDumpCopyListToFile@4" (ByVal szFile$) AS LONG
  1106. DECLARE PUBLIC SUB      ResetCopyList LIB "lcomstf.dll" ALIAS "_ResetCopyList@0" ()
  1107. DECLARE PUBLIC SUB      ResetFileCosts LIB "lcomstf.dll" ALIAS "_ResetFileCosts@0" ()
  1108. DECLARE PUBLIC FUNCTION FRemoveSectionFilesFromCopyList LIB "lcomstf.dll" ALIAS "_FRemoveSectionFilesFromCopyList@4" (ByVal szSect$) AS LONG
  1109. DECLARE PUBLIC FUNCTION FRemoveSectionKeyFileFromCopyList LIB "lcomstf.dll" ALIAS "_FRemoveSectionKeyFileFromCopyList@8" (ByVal szSect$, ByVal szKey$) AS LONG
  1110. DECLARE PUBLIC FUNCTION FSetBeepingMode LIB "lcomstf.dll" ALIAS "_FSetBeepingMode@4" (ByVal mode&) AS LONG
  1111. DECLARE PUBLIC SUB      ProSetPos LIB "lcomstf.dll" ALIAS "_ProSetPos@8" (ByVal x&, ByVal y&)
  1112. DECLARE PUBLIC FUNCTION GrcCopyFilesInCopyList LIB "lcomstf.dll" ALIAS "_GrcCopyFilesInCopyList@4" (ByVal hInstance&) AS LONG
  1113. DECLARE PUBLIC FUNCTION LcbGetCopyListCost LIB "lcomstf.dll" ALIAS "_LcbGetCopyListCost@12" (ByVal szExtraList$, ByVal szCostList$, ByVal szNeedList$) AS LONG
  1114. DECLARE PUBLIC FUNCTION FAddToBillboardList LIB "lcomstf.dll" ALIAS "_FAddToBillboardList@16" (ByVal szDll$, ByVal idDlg&, ByVal szProc$, ByVal lTicks&) AS LONG
  1115. DECLARE PUBLIC FUNCTION FClearBillboardList LIB "lcomstf.dll" ALIAS "_FClearBillboardList@0" () AS LONG
  1116. DECLARE PUBLIC FUNCTION SetCopyMode LIB "lcomstf.dll" ALIAS "_SetCopyMode@4" (ByVal fMode&) AS LONG
  1117. DECLARE PUBLIC FUNCTION GetCopyMode LIB "lcomstf.dll" ALIAS "_GetCopyMode@0" () AS LONG
  1118. DECLARE PUBLIC FUNCTION SetSizeCheckMode LIB "lcomstf.dll" ALIAS "_SetSizeCheckMode@4" (ByVal scmMode&) AS LONG
  1119. DECLARE PUBLIC FUNCTION LcbGetInfSectionSize LIB "lcomstf.dll" ALIAS "_LcbGetInfSectionSize@4" (ByVal szSect$)  AS LONG
  1120. DECLARE PUBLIC FUNCTION FSetSilent LIB "lcomstf.dll" ALIAS "_FSetSilent@4" (ByVal mode&) AS LONG
  1121. DECLARE PUBLIC FUNCTION ReadSerialNumber LIB "lcomstf.dll" ALIAS "_ReadSerialNumber@8" (ByVal szSrc$,ByVal szSerial$) AS LONG
  1122. DECLARE PUBLIC FUNCTION WriteUserRegistration LIB "lcomstf.dll" ALIAS "_WriteUserRegistration@16" (ByVal szRi$,ByVal szUser$,ByVal szCompany$,ByVal szSerial$) AS LONG
  1123. DECLARE PUBLIC FUNCTION ReadUserRegistration LIB "lcomstf.dll" ALIAS "_ReadUserRegistration@16" (ByVal szRi$,ByVal szUser$,ByVal szCompany$,ByVal szSerial$) AS LONG
  1124. DECLARE PUBLIC FUNCTION FPopulateLCB LIB "lcomstf.dll" ALIAS "_FPopulateLCB@8" (ByVal hDlg&,ByVal Chapter$) AS LONG
  1125. DECLARE PUBLIC FUNCTION FSetDateOfFile LIB "lcomstf.dll" ALIAS "_FSetDateOfFile@8" (ByVal szFile$,ByVal szDate$) AS LONG
  1126. DECLARE PUBLIC FUNCTION FGetFirstChild LIB "lcomstf.dll" ALIAS "_FGetFirstChild@12" (ByVal szChapter$,ByVal szFirsthapter$, ByVal nField&) AS LONG
  1127. DECLARE PUBLIC FUNCTION FGetFirst LIB "lcomstf.dll" ALIAS "_FGetFirst@12" (ByVal szChapter$,ByVal szFirsthapter$, ByVal nField&) AS LONG
  1128. DECLARE PUBLIC FUNCTION FGetChapterValStr LIB "lcomstf.dll" ALIAS "_FGetChapterValStr@16" (ByVal szChapter$,ByVal nField&, ByVal szBuf$,ByVal cbBuf&) AS LONG
  1129. DECLARE PUBLIC FUNCTION FGetChapterValInt LIB "lcomstf.dll" ALIAS "_FGetChapterValInt@12" (ByVal szChapter$,ByVal nField&, lpVal&) AS LONG
  1130. DECLARE PUBLIC FUNCTION FGetNextSibling LIB "lcomstf.dll" ALIAS "_FGetNextSibling@12" (ByVal szChapter$,ByVal szNextChapter$,ByVal nField&) AS LONG
  1131. DECLARE PUBLIC FUNCTION FGetNextChild LIB "lcomstf.dll" ALIAS "_FGetNextChild@4" (ByVal szNextChildChapter$) AS LONG
  1132. DECLARE PUBLIC FUNCTION FGetNext LIB "lcomstf.dll" ALIAS "_FGetNext@4" (ByVal szNextChapter$) AS LONG
  1133. DECLARE PUBLIC FUNCTION FToggleChapterFilesInCopyList LIB "lcomstf.dll" ALIAS "_FToggleChapterFilesInCopyList@4" (ByVal szChapter$) AS LONG
  1134. DECLARE PUBLIC FUNCTION LcbGetInfChapterSize LIB "lcomstf.dll" ALIAS "_LcbGetInfChapterSize@4" (ByVal szChapter$)  AS LONG
  1135. DECLARE PUBLIC FUNCTION FInitializeCopyList LIB "lcomstf.dll" ALIAS "_FInitializeCopyList@12" (ByVal szChpt$, ByVal szSourcedir$, ByVal nField&) AS LONG
  1136. DECLARE PUBLIC FUNCTION FRefreshDestination LIB "lcomstf.dll" ALIAS "_FRefreshDestination@4" (ByVal lpszSym$) AS LONG 
  1137. DECLARE PUBLIC FUNCTION FWriteDestinationSymAndVal LIB "lcomstf.dll" ALIAS "_FWriteDestinationSymAndVal@8" (ByVal lpszIniFile$,ByVal lpszIniSec$) AS LONG 
  1138. DECLARE PUBLIC FUNCTION FSetRestartDir LIB "lcomstf.dll" ALIAS "_FSetRestartDir@4" (ByVal szDir$) AS LONG
  1139. DECLARE PUBLIC FUNCTION FRestartListEmpty LIB "lcomstf.dll" ALIAS "_FRestartListEmpty@0" () AS LONG
  1140. DECLARE PUBLIC FUNCTION FExitExecRestart LIB "lcomstf.dll" ALIAS "_FExitExecRestart@0" () AS LONG
  1141. '** The following are not normally exposed by CIT
  1142. DECLARE PUBLIC FUNCTION FSetChapterValInt LIB "lcomstf.dll" ALIAS "_FSetChapterValInt@12" (ByVal szChapter$, ByVal nField%, ByVal nValue%) AS LONG
  1143. '****************  Tabs UI Declarations  *********************************
  1144.  
  1145. DECLARE PUBLIC FUNCTION DriveType LIB "mscuistf.dll" ALIAS "_DriveType@4" (ByVal drivetype&) AS LONG
  1146. DECLARE PUBLIC FUNCTION RegisterFunction LIB "mscuistf.dll"  ALIAS "_RegisterFunction@12" (ByVal sess&, ByVal modname$, ByVal fname$) AS INTEGER
  1147. DECLARE PUBLIC FUNCTION NotebookAddDlgPage LIB "mscuistf.dll" ALIAS "_NotebookAddDlgPage@24" (ByVal  hDlg&,_
  1148.     ByVal idNotebook&, ByVal  idDlg&, ByVal lpszDllName$, ByVal lpszDlgProc$,_
  1149.     ByVal lpszTab$) AS LONG
  1150. DECLARE PUBLIC FUNCTION FNotebookPageView LIB "mscuistf.dll" ALIAS "_FNotebookPageView@16" (ByVal hDlg&,_
  1151.           ByVal idNotebook&, ByVal  idDlg&, ByVal fShowPage&) AS LONG
  1152. DECLARE PUBLIC FUNCTION FNotebookTurnToPage LIB "mscuistf.dll" ALIAS "_FNotebookTurnToPage@12" (ByVal hDlg&,ByVal idNotebook&,ByVal id&) AS LONG
  1153. DECLARE PUBLIC FUNCTION NotebookGetPageHwnd LIB "mscuistf.dll" ALIAS "_NotebookGetPageHwnd@12" (ByVal hDlg&,ByVal idNotebook&,ByVal idPage&) AS LONG
  1154. DECLARE PUBLIC SUB      LCBResetContent LIB "mscuistf.dll" ALIAS "_LCBResetContent@4" (ByVal hDlg&)
  1155. DECLARE PUBLIC SUB      LCBSetRedraw LIB "mscuistf.dll" ALIAS "_LCBSetRedraw@8" (ByVal hDlg&, ByVal fRedraw&)
  1156. DECLARE PUBLIC FUNCTION LCBGetCount LIB "mscuistf.dll" ALIAS "_LCBGetCount@4" (ByVal hDlg&) AS LONG
  1157. DECLARE PUBLIC FUNCTION LCBAddItem LIB "mscuistf.dll" ALIAS "_LCBAddItem@8" (ByVal hDlg&, ByVal item$) AS LONG
  1158. DECLARE PUBLIC FUNCTION LCBReplaceItem LIB "mscuistf.dll" ALIAS "_LCBReplaceItem@16" (ByVal hDlg&, ByVal index&, ByVal itemnum&, ByVal item$) AS LONG
  1159. DECLARE PUBLIC FUNCTION LCBGetItem LIB "mscuistf.dll" ALIAS "_LCBGetItem@20" (ByVal hDlg&, ByVal index&, ByVal itemnum&, ByVal item$, ByVal itemmax&) AS LONG
  1160. DECLARE PUBLIC FUNCTION LCBToggleItem LIB "mscuistf.dll" ALIAS "_LCBToggleItem@8" (ByVal hDlg&, ByVal index&) AS LONG
  1161. DECLARE PUBLIC SUB      LCBSetSel LIB "mscuistf.dll" ALIAS "_LCBSetSel@8" (ByVal hDlg&, ByVal index&) 
  1162. DECLARE PUBLIC SUB      LCBSetTabs LIB "mscuistf.dll" ALIAS "_LCBSetTabs@20" (ByVal hDlg&, ByVal t1&,ByVal t2&,ByVal t3&,ByVal t4&)
  1163. DECLARE PUBLIC FUNCTION FGetDriveFreeSpaceList LIB "mscuistf.dll" ALIAS "_FGetDriveFreeSpaceList@4" (ByVal szSymbol$) AS LONG
  1164.  
  1165. '** UNC stuff
  1166. DECLARE PUBLIC FUNCTION FAddToDriveFreeSpaceList LIB "mscuistf.dll" ALIAS "_FAddToDriveFreeSpaceList@8" (ByVal szSymbol$,ByVal szNewItem$) AS LONG
  1167. DECLARE PUBLIC FUNCTION FIsUnvalidatedUNCPath LIB "mscuistf.dll" ALIAS "_FIsUnvalidatedUNCPath@4" (ByVal szPath$) AS LONG
  1168. DECLARE PUBLIC FUNCTION FIsValidUNCPath LIB "mscuistf.dll" ALIAS "_FIsValidUNCPath@4" (ByVal szPath$) AS LONG
  1169. DECLARE PUBLIC FUNCTION FGetGroupName LIB "mscuistf.dll" ALIAS "_FGetGroupName@12" (ByVal szGroupFileName$, ByVal szBuf$,ByVal cbBuf&) AS LONG
  1170. '** end UNC stuff
  1171.  
  1172. '*************** Wrappers for MS functions that Lotus re-wrote **************
  1173.  
  1174. DECLARE PUBLIC SUB      ReadInfFile (szFile$)
  1175. DECLARE PUBLIC SUB      MakeListFromSectionKeys (szSymbol$, szSect$)
  1176. DECLARE PUBLIC SUB      MakeListFromSectionDate (szSym$, szSect$)
  1177. DECLARE PUBLIC SUB      MakeListFromSectionFilename (szSym$, szSect$)
  1178. DECLARE PUBLIC SUB      MakeListFromSectionSize (szSym$, szSect$)
  1179. DECLARE PUBLIC SUB      MakeListFromSectionVersion (szSym$, szSect$)
  1180. DECLARE PUBLIC FUNCTION SetSilentMode (mode%) AS INTEGER
  1181. DECLARE PUBLIC FUNCTION SetBeepingMode (mode%) AS INTEGER
  1182. DECLARE PUBLIC FUNCTION GetSectionKeyDate (szSect$, szKey$) AS STRING
  1183. DECLARE PUBLIC FUNCTION GetSectionKeyFilename (szSect$, szKey$) AS STRING
  1184. DECLARE PUBLIC FUNCTION GetSectionKeySize (szSect$, szKey$) AS LONG
  1185. DECLARE PUBLIC FUNCTION GetSectionKeyVersion (szSect$, szKey$) AS STRING
  1186. DECLARE PUBLIC SUB      RemoveDir (szDir$, cmo%)
  1187. DECLARE PUBLIC SUB      DumpCopyList (szFile$)
  1188. DECLARE PUBLIC SUB      ClearCopyList
  1189. DECLARE PUBLIC FUNCTION GetCopyListCost (szExtraList$, szCostList$, szNeedList$) AS LONG
  1190. DECLARE PUBLIC SUB      CopyFilesInCopyList
  1191. DECLARE PUBLIC SUB      AddSectionFilesToCopyList (szSect$, szSrc$, szDest$)
  1192. DECLARE PUBLIC SUB      AddSectionKeyFileToCopyList (szSect$, szKey$, szSrc$, szDest$)
  1193. DECLARE PUBLIC SUB      AddToBillboardList (szDll$, idDlg&, szProc$, lTicks&)
  1194. DECLARE PUBLIC SUB      AddBlankToBillboardList (lTicks&)
  1195. DECLARE PUBLIC SUB      ClearBillboardList
  1196. DECLARE PUBLIC SUB      SetCopyGaugePosition (x%, y%)
  1197. DECLARE PUBLIC SUB      SetRestartDir(szDir$)
  1198. DECLARE PUBLIC FUNCTION RestartListEmpty AS INTEGER
  1199. DECLARE PUBLIC FUNCTION ExitExecRestart AS INTEGER
  1200.  
  1201. '** Utility functions
  1202.  
  1203. DECLARE PUBLIC FUNCTION GetAbsPathFromIni(szFile$,szSect$,szKey$,nullflag%,invalidpathflag%) AS STRING
  1204. DECLARE PUBLIC FUNCTION MakePath (szDir$, szFile$) AS STRING
  1205. DECLARE PUBLIC SUB      ShowPathError (nmsg%, nDescription%, szPath$)
  1206. DECLARE PUBLIC SUB      ShowPathErrorNoDlgExit (nmsg%, nDescription%, szPath$)
  1207. DECLARE PUBLIC FUNCTION IsPathWritable (szPath$) AS INTEGER
  1208. DECLARE PUBLIC FUNCTION ValidatePath (szPath$) AS INTEGER
  1209. DECLARE PUBLIC FUNCTION RegisterCallback (ReturnStr$, FuncName$) AS INTEGER
  1210. DECLARE PUBLIC FUNCTION PopupModalDlg (Dlg%, HelpID&) AS STRING
  1211. DECLARE PUBLIC FUNCTION PopupModelessDlg (Dlg%, HelpID&) AS STRING
  1212. DECLARE PUBLIC FUNCTION SelectDriveCombo (ComboID$, path$) AS INTEGER
  1213. DECLARE PUBLIC FUNCTION CheckForSpace (DlgId%) AS INTEGER
  1214. DECLARE PUBLIC SUB      QUIT
  1215. DECLARE PUBLIC SUB      Lot_WriteDestinationSymAndVal(IniFileName$,IniSection$) 
  1216. DECLARE PUBLIC SUB      Lot_WriteCriticalDirectories (InstallIniFile$)
  1217. DECLARE PUBLIC FUNCTION Lot_WriteToRiFile (ripath$) AS INTEGER
  1218. DECLARE PUBLIC FUNCTION Lot_ReadDefaultsfromRi (default_ripath$) AS INTEGER
  1219. DECLARE PUBLIC FUNCTION Lot_TrimEndSlash (path$) AS STRING
  1220. DECLARE PUBLIC FUNCTION Lot_AreShareToolsSupported () AS INTEGER
  1221. DECLARE PUBLIC FUNCTION Lot_AreShare32ToolsSupported () AS INTEGER
  1222. DECLARE PUBLIC FUNCTION Lot_CallSharedTool (func$) AS INTEGER
  1223. DECLARE PUBLIC FUNCTION GetNotesPathfromLotusIni() AS STRING
  1224. DECLARE PUBLIC FUNCTION IsNotesInPath() AS INTEGER
  1225. DECLARE PUBLIC FUNCTION IsShareInAUTOEXEC() AS INTEGER
  1226. DECLARE PUBLIC FUNCTION ModifyAutoexec(modflag%,directmod%,backup$) AS STRING
  1227. DECLARE PUBLIC FUNCTION GetBootDrive() AS STRING
  1228. DECLARE PUBLIC FUNCTION Lot_GetLotusNotesDataPath() AS STRING
  1229. DECLARE PUBLIC FUNCTION Lot_GetORACLEHomePath() AS STRING
  1230. DECLARE PUBLIC FUNCTION Lot_GetLotusNotesPrgPath() AS STRING
  1231. 'DECLARE PUBLIC FUNCTION GetLotusNotesDataPath(szFile$, szSect$, szKey$) AS STRING
  1232. DECLARE PUBLIC SUB      DL_SetOraclePath
  1233. DECLARE PUBLIC SUB      DL_SetNotesDataPath
  1234. DECLARE PUBLIC FUNCTION TrimNetlotusapp (ByVal path$) AS STRING
  1235. DECLARE PUBLIC FUNCTION GetLastPathComponent( ByVal szPath$) AS STRING
  1236.  
  1237. '** Lotus functions
  1238.  
  1239. DECLARE PUBLIC FUNCTION Lot_GetLocalHardDrive (ProdSize&,DefaultDir$) AS STRING
  1240. DECLARE PUBLIC FUNCTION Lot_GetNetHardDrive (ProdSize&,DefaultDir$) AS STRING
  1241. DECLARE PUBLIC FUNCTION Lot_GetAllHardDrive(ProdSize&,DefaultDir$) AS STRING
  1242. DECLARE PUBLIC FUNCTION Lot_Dir  (szDir$) AS STRING
  1243. DECLARE PUBLIC FUNCTION Lot_GetChapterFromKeyword (szKeyword$) AS STRING
  1244. DECLARE PUBLIC FUNCTION Lot_CallProductFunctions (func_name$, BYVAL direction$, always%, back$, parms$) AS STRING
  1245. DECLARE PUBLIC FUNCTION Lot_CallOneProductFunction (prodno%, func_name$, BYVAL direction$, always%, parms$) AS STRING
  1246. DECLARE PUBLIC FUNCTION Lot_CheckPath (path$) AS INTEGER
  1247. DECLARE PUBLIC FUNCTION Lot_GetInfSectionSize (szSect$)  AS LONG
  1248. DECLARE PUBLIC SUB      Lot_RemoveSectionFilesFromCopyList (szSect$)
  1249. DECLARE PUBLIC SUB      Lot_RemoveSectionKeyFileFromCopyList (szSect$, szKey$)
  1250. DECLARE PUBLIC FUNCTION Lot_SetDateOfFile (szFile$, szDate$) AS INTEGER
  1251. DECLARE PUBLIC FUNCTION Lot_GetFirst (szChapt$, nFlag%) AS STRING
  1252. DECLARE PUBLIC FUNCTION Lot_GetNext () AS STRING
  1253. DECLARE PUBLIC FUNCTION Lot_AddPagetoNotebook (hDlg&,  Notebookid&, DlgId%,Tabstring$) AS INTEGER
  1254. DECLARE PUBLIC FUNCTION Lot_NotebookPageView (hDlg&,  Notebookid&, DlgId%, fShowPage%) AS INTEGER
  1255. DECLARE PUBLIC SUB      Lot_TurnToPage (hDlg&,Notebookid&, pageid%) 
  1256. DECLARE PUBLIC FUNCTION Lot_GetPagehandle  (hDlg&,Notebookid&,Pageid%) AS LONG
  1257. DECLARE PUBLIC SUB      Lot_LCBResetContent     (hDlg&)
  1258. DECLARE PUBLIC SUB      Lot_LCBSetRedraw        (hDlg&, fRedraw%)
  1259. DECLARE PUBLIC FUNCTION Lot_LCBGetCount    (hDlg&) AS INTEGER
  1260. DECLARE PUBLIC FUNCTION Lot_LCBAddItem     (hDlg&, item$) AS INTEGER
  1261. DECLARE PUBLIC FUNCTION Lot_LCBReplaceItem (hDlg&, index%, itemnum%, item$) AS INTEGER
  1262. DECLARE PUBLIC FUNCTION Lot_LCBGetItem     (hDlg&, index%, itemnum%) AS STRING
  1263. DECLARE PUBLIC FUNCTION Lot_LCBToggleItem  (hDlg&, index%) AS INTEGER
  1264. DECLARE PUBLIC SUB      Lot_LCBSetSel           (hDlg&, index%)
  1265. DECLARE PUBLIC SUB      Lot_LCBSetTabs           (hDlg&, t1%,t2%,t3%,t4%)
  1266. DECLARE PUBLIC FUNCTION Lot_GetFirstChild (szChapt$, nFlag%) AS STRING
  1267. DECLARE PUBLIC FUNCTION Lot_GetChapterValStr (szChapter$, nField%) AS STRING  
  1268. DECLARE PUBLIC FUNCTION Lot_GetChapterValInt (szChapter$,nField%) AS INTEGER  
  1269. DECLARE PUBLIC FUNCTION Lot_GetNextSibling (szChapter$,nField%) AS STRING
  1270. DECLARE PUBLIC FUNCTION Lot_GetNextChild () AS STRING
  1271. DECLARE PUBLIC FUNCTION Lot_GetInfChapterSize (szChapter$)  AS LONG
  1272. DECLARE PUBLIC SUB      Lot_ToggleChapterFilesInCopyList (szChapter$)  
  1273. DECLARE PUBLIC FUNCTION Lot_SetChapterFilesInCopyListInOrOut (szChapter$, InOrOut%)  AS INTEGER
  1274. DECLARE PUBLIC SUB      Lot_InitializeCopyList (chpt$, nField%) 
  1275. DECLARE PUBLIC SUB      Lot_RefreshDestination (symbol$) 
  1276. DECLARE PUBLIC SUB      Lot_GetDriveFreeSpaceList (szSymbol$)
  1277. DECLARE PUBLIC FUNCTION Lot_GetSharedToolsSize() AS INTEGER
  1278. DECLARE PUBLIC FUNCTION Lot_GetShared32ToolsSize() AS INTEGER
  1279. DECLARE PUBLIC FUNCTION Lot_MakeSizeString (size AS LONG) AS STRING
  1280. DECLARE PUBLIC FUNCTION Lot_ExtractDriveLetter (destdir$) AS STRING
  1281. DECLARE PUBLIC FUNCTION Lot_ExtractDirectory (destdir$) AS STRING
  1282. DECLARE PUBLIC FUNCTION Lot_GetGroupName ( szGroupFileName$) AS STRING  
  1283. DECLARE PUBLIC FUNCTION Lot_IsTheFeatureInstalled(s$) AS INTEGER
  1284. DECLARE PUBLIC FUNCTION Lot_WhereIsFeature(prodno%, featureId$, filetolookfor$) AS STRING
  1285. DECLARE PUBLIC FUNCTION Lot_GetDestDirValueFromInstallini(DestDirSym$) AS STRING
  1286. DECLARE PUBLIC SUB Lot_InitializeWinWinsysSym () 
  1287. DECLARE PUBLIC SUB Lot_InitializeEXTRA ()
  1288. DECLARE PUBLIC FUNCTION Lot_IsDestVerNewerOrEqual(DestinationPath$,SourceVer1&,SourceVer2&,SourceVer3&,SourceVer4&) AS INTEGER
  1289. DECLARE PUBLIC SUB      Lot_CallWinhelp32 (prodno%, network$, SectionName$, DestDirSym$, FileName$) 
  1290.  
  1291. '** UNC stuff
  1292. DECLARE PUBLIC SUB Lot_SplitUNCPath (szFullPath$, szVol$, szDirPath$)
  1293. DECLARE PUBLIC FUNCTION Lot_AddToDriveFreeSpaceList (szSymbol$, szNewItem$) AS LONG
  1294. DECLARE PUBLIC FUNCTION Lot_IsUnvalidatedUNCPath (szPath$) AS LONG
  1295. DECLARE PUBLIC FUNCTION Lot_IsValidUNCPath (szPath$) AS LONG
  1296. DECLARE PUBLIC FUNCTION FMapUNCVolume LIB "mscuistf.dll" ALIAS "_FMapUNCVolume@8" (ByVal szUNCRoot$, ByVal szDrive$) AS LONG
  1297. DECLARE PUBLIC FUNCTION FUnmapUNCVolume LIB "mscuistf.dll" ALIAS "_FUnmapUNCVolume@4" (ByVal szDrive$) AS LONG
  1298. DECLARE PUBLIC FUNCTION ValidateEditBox (hDlg&, Ctrl%) AS INTEGER
  1299. DECLARE PUBLIC FUNCTION ValidateBrowse (hDlg&, Ctrl%) AS INTEGER
  1300. '** end UNC stuff
  1301.  
  1302. 'Registration functions moved to REGISTER.LSS
  1303.  
  1304. DECLARE PUBLIC FUNCTION Lot_GetCurrentProduct() AS INTEGER
  1305. DECLARE PUBLIC SUB      Lot_SetCurrentProduct(ProdNo%) 
  1306. DECLARE PUBLIC FUNCTION Lot_GetInstallDir() AS STRING
  1307. DECLARE PUBLIC FUNCTION Lot_GetTheRealProdDir(prodno%) AS STRING
  1308. DECLARE PUBLIC FUNCTION Lot_Readserialnumber () AS INTEGER
  1309. DECLARE PUBLIC FUNCTION Lot_SaveFeaturesInstaledInInstallIni() AS INTEGER
  1310. DECLARE PUBLIC FUNCTION Lot_SaveFeaturesInstaledInInstNodeIni() AS INTEGER
  1311. DECLARE PUBLIC FUNCTION Lot_SaveTheNodeOptionsInInstallIni() AS INTEGER
  1312. DECLARE PUBLIC FUNCTION Lot_IsTheNodeOptionsAvailToNode(prodNum%,OptName$) AS INTEGER
  1313. DECLARE PUBLIC FUNCTION Lot_IsAnyNodeOptAvailToNode()AS INTEGER
  1314. DECLARE PUBLIC FUNCTION Lot_AreNodeOptAvailToNodeForProd(prodNum%) AS INTEGER
  1315. DECLARE PUBLIC FUNCTION Lot_GetNumOfNodeOptAvailToNodeForProd(prodNum%) AS INTEGER
  1316. DECLARE PUBLIC FUNCTION Lot_AreAnyNodeOptAvailToSrv() AS INTEGER
  1317.  
  1318. DECLARE PUBLIC FUNCTION Lot_SaveTheCDOptionsInInstallIni() AS INTEGER
  1319. DECLARE PUBLIC FUNCTION Lot_IsTheCDOptionsAvailToNode(prodNum%,OptName$) AS INTEGER
  1320. DECLARE PUBLIC FUNCTION Lot_IsAnyCDOptAvailToNode()AS INTEGER
  1321. DECLARE PUBLIC FUNCTION Lot_AreCDOptAvailToNodeForProd(prodNum%) AS INTEGER
  1322. DECLARE PUBLIC FUNCTION Lot_GetNumOfCDOptAvailToNodeForProd(prodNum%) AS INTEGER
  1323. DECLARE PUBLIC FUNCTION Lot_AreAnyCDOptAvailToSrv() AS INTEGER
  1324.  
  1325. '** Win95 uninstaller functions
  1326. DECLARE PUBLIC FUNCTION Lot_RegisterUninstaller(ProdRegKeyName$,ProdVer$,_
  1327.                         ProdDisplayedName$,ProdInfPath$,_
  1328.                         LogFlag%,AutoFlag%,_
  1329.                         LangID$,LogFile$,RspFile$,_
  1330.                         UserName$ ) AS INTEGER
  1331. DECLARE PUBLIC FUNCTION Lot_RegisterObject(FeatureKeyWord$,ClassOfObject$,_
  1332.                         ObjectPath$)
  1333.  
  1334. '** Resource splitting functions
  1335.  
  1336. DECLARE PUBLIC FUNCTION FindResourceinDLL (idDlg&, ResType%) AS STRING
  1337.  
  1338. '** Local functions
  1339.  
  1340. DECLARE PUBLIC SUB DisplayWhenSpaceIsTight(szCost$,szNeed$)
  1341. DECLARE FUNCTION Lot_GetLastFeatureNumber() AS INTEGER
  1342. DECLARE FUNCTION Lot_GetLastNodeOptNumber(s$) AS INTEGER
  1343. DECLARE FUNCTION Lot_GetLastCDOptNumber(s$) AS INTEGER
  1344.  
  1345. '** Local globals
  1346.  
  1347. PUBLIC gEndStatementEncountered% ' TRUE when END statement encountered
  1348.  
  1349. '**************************************************************************
  1350.  
  1351. SUB INITIALIZE
  1352. '** Purpose:   Sets the begining of the Product registration array
  1353. '** Arguments:
  1354. '*************************************************************************
  1355.  gCurrNumOfProds% = 0
  1356.  gCurrentProduct% = 1
  1357. ' Moved from main because of symbol initialization in early LdString calls
  1358.  
  1359.    ON Error STFQUIT    GOTO MAINERROR
  1360.    ON Error STFERR     GOTO STFERR_
  1361.    ON Error STFTOGGLE  GOTO STFTOGGLEERR
  1362.  
  1363.     ToolKitInitalizeError& = 0
  1364.     SetUpAPI
  1365.  
  1366.     EXIT SUB
  1367.  
  1368. MAINERROR:
  1369.     ToolKitInitalizeError& = STFQUIT
  1370.     EXIT SUB
  1371.         
  1372. STFERR_:
  1373.     ToolKitInitalizeError& = STFERR
  1374.     EXIT SUB
  1375.  
  1376. STFTOGGLEERR:
  1377.     ToolKitInitalizeError& = STFTOGGLE
  1378.  
  1379. END SUB
  1380.  
  1381. PUBLIC FUNCTION Lot_GetSharedToolsSize() AS INTEGER
  1382. '** Purpose:
  1383. '**     Gets the size of the shared tools in Kb
  1384. '** Arguments:
  1385. '** Returns:
  1386. '**     the size or 0
  1387. '*************************************************************************
  1388.    DIM CurrChpt$, SharedID$, ShareSize&
  1389.  
  1390.    CurrChpt$ = Lot_GetFirst("", F_SHARE+F_INOROUT) 
  1391.    WHILE (CurrChpt$ <> "")
  1392.       SharedID$ = Lot_GetChapterValStr(CurrChpt$, F_SHARE)   
  1393.       IF SharedID$="IVCPROGRAM" OR _
  1394.      SharedID$="CONTAINERFILEPROGRAM" OR _
  1395.      SharedID$="DATALENSPROGRAM" OR _
  1396.      SharedID$="DATALENSDATA" OR _
  1397.      SharedID$="DIALOGEDITORPROGRAM" OR _
  1398.      SharedID$="DESKTOP" OR _
  1399.      SharedID$="DOCUMENTFILEFILTERSPROGRAM" OR _
  1400.      SharedID$="DOCUMENTFILEFILTERSFILTER" OR _
  1401.      SharedID$="GRAMMARCHECKERPROGRAM" OR _
  1402.      SharedID$="GRAMMARCHECKERDATA" OR _
  1403.      SharedID$="GRAPHICFILEFILTERSPROGRAM" OR _
  1404.      SharedID$="HYPHENATIONPROGRAM" OR _
  1405.      SharedID$="HYPHENATIONDATA" OR _
  1406.      SharedID$="ICONPALETTEPROGRAM" OR _
  1407.      SharedID$="INFOBOXPROGRAM" OR _
  1408.      SharedID$="SCRIPTPROGRAM" OR _
  1409.      SharedID$="MULTIMEDIAPROGRAM" OR _
  1410.      SharedID$="MULTIMEDIADATA" OR _
  1411.      SharedID$="SPELLCHECKERPROGRAM" OR _
  1412.      SharedID$="SPELLCHECKERDATA" OR _
  1413.      SharedID$="SPELLCHECKERUSER" OR _
  1414.      SharedID$="STATUSBARPROGRAM" OR _
  1415.      SharedID$="THESAURUSPROGRAM" OR _
  1416.      SharedID$="THESAURUSDATA" OR _
  1417.      SharedID$="TOOLSPROGRAM" OR _
  1418.      SharedID$="TOOLSDATA" OR _
  1419.      SharedID$="USERNAMESERVICESPROGRAM" OR _
  1420.      SharedID$="FILTERS" OR _
  1421.      SharedID$="EXCELFLT" THEN
  1422.      
  1423.         ShareSize& = ShareSize&+Lot_GetInfChapterSize(CurrChpt$)
  1424.  
  1425.       END IF
  1426.  
  1427.       CurrChpt$ = Lot_GetNext() 
  1428.  
  1429.    WEND
  1430.  
  1431.    Lot_GetSharedToolsSize = INT(ShareSize&/1024)
  1432.  
  1433. 'testint% = INT(ShareSize& / 1024)
  1434. 'Lot_GetSharedToolsSize = testint%
  1435. 'DoMsgBox("testint%", STR$(testint%), MB_OK)
  1436.  
  1437. END FUNCTION
  1438.  
  1439.  
  1440. PUBLIC FUNCTION Lot_GetShared32ToolsSize() AS INTEGER
  1441. '** Purpose:
  1442. '**     Gets the size of the shared tools for Win32 in Kb
  1443. '** Arguments:
  1444. '** Returns:
  1445. '**     the size or 0
  1446. '*************************************************************************
  1447.    DIM CurrChpt$, SharedID$, ShareSize&
  1448.  
  1449.    CurrChpt$ = Lot_GetFirst("", F_SHARE+F_INOROUT) 
  1450.    WHILE (CurrChpt$ <> "")
  1451.       SharedID$ = Lot_GetChapterValStr(CurrChpt$, F_SHARE)   
  1452.       IF SharedID$="WIN32IVCPROGRAM" OR _
  1453.      SharedID$="WIN32CONTAINERFILEPROGRAM" OR _
  1454.      SharedID$="WIN32DATALENSPROGRAM" OR _
  1455.      SharedID$="WIN32DATALENSDATA" OR _
  1456.      SharedID$="WIN32DIALOGEDITORPROGRAM" OR _
  1457.      SharedID$="WIN32DESKTOP" OR _
  1458.      SharedID$="WIN32DOCUMENTFILEFILTERSPROGRAM" OR _
  1459.      SharedID$="WIN32DOCUMENTFILEFILTERSFILTER" OR _
  1460.      SharedID$="WIN32GRAMMARCHECKERPROGRAM" OR _
  1461.      SharedID$="WIN32GRAMMARCHECKERDATA" OR _
  1462.      SharedID$="WIN32GRAPHICFILEFILTERSPROGRAM" OR _
  1463.      SharedID$="WIN32HYPHENATIONPROGRAM" OR _
  1464.      SharedID$="WIN32HYPHENATIONDATA" OR _
  1465.      SharedID$="WIN32ICONPALETTEPROGRAM" OR _
  1466.      SharedID$="WIN32INFOBOXPROGRAM" OR _
  1467.      SharedID$="WIN32SCRIPTPROGRAM" OR _
  1468.      SharedID$="WIN32MULTIMEDIAPROGRAM" OR _
  1469.      SharedID$="WIN32MULTIMEDIADATA" OR _
  1470.      SharedID$="WIN32SPELLCHECKERPROGRAM" OR _
  1471.      SharedID$="WIN32SPELLCHECKERDATA" OR _
  1472.      SharedID$="WIN32SPELLCHECKERUSER" OR _
  1473.      SharedID$="WIN32STATUSBARPROGRAM" OR _
  1474.      SharedID$="WIN32THESAURUSPROGRAM" OR _
  1475.      SharedID$="WIN32THESAURUSDATA" OR _
  1476.      SharedID$="WIN32TOOLSPROGRAM" OR _
  1477.      SharedID$="WIN32TOOLSDATA" OR _
  1478.      SharedID$="WIN32USERNAMESERVICESPROGRAM" OR _
  1479.      SharedID$="WIN32FILTERS" OR _
  1480.      SharedID$="WIN32EXCELFLT" THEN
  1481.      
  1482.         ShareSize& = ShareSize&+Lot_GetInfChapterSize(CurrChpt$)
  1483.  
  1484.       END IF
  1485.  
  1486.       CurrChpt$ = Lot_GetNext() 
  1487.  
  1488.    WEND
  1489.  
  1490.    Lot_GetShared32ToolsSize = INT(ShareSize&/1024)
  1491.  
  1492. 'testint% = INT(ShareSize& / 1024)
  1493. 'Lot_GetSharedToolsSize = testint%
  1494. 'DoMsgBox("testint%", STR$(testint%), MB_OK)
  1495.  
  1496. END FUNCTION
  1497.  
  1498.  
  1499. '*********************************************************
  1500.  
  1501. PUBLIC FUNCTION GetAbsPathFromIni(szFile$,szSect$,szKey$,nullflag%,invalidpathflag%) AS STRING
  1502. '** Purpose: This function is called whenever we need to retrieve a string
  1503. '**           from .ini file. Function returns a clean path (path returned from
  1504. '**           FCleanFatPath.    
  1505. '** Author:    JKK
  1506. '** Arguments:  Name of the .ini file, section name in the .ini file, key we
  1507. '**             are searching for and two integer flags, nullflag% & invalidpath%.
  1508. '**             Function puts up two error messages based on the value of nullflag%, and 
  1509. '**             invalidpath. 
  1510. '** Returns:   Function either returns null or the value of the string.
  1511. '**     
  1512. '*************************************************************************
  1513.   DIM rstring$, rv%, errText$
  1514.  
  1515.    GetAbsPathFromIni = ""
  1516.    rstring$ = GetIniKeyString(szFile$, szSect$, szKey$)
  1517.    If rstring$ <> "" Then
  1518.  
  1519.       rv% = Lot_CleanPath(rstring$)
  1520.  
  1521.       'tqi - I believe this trim should no longer be necessary, but no harm to leave it 
  1522.       errText$ =  NullTrim(szFile$)
  1523.       if rv% <> 0 Then
  1524.      GetAbsPathFromIni = rstring$
  1525.       elseif invalidpathflag% <> FALSE then
  1526.  
  1527.      ErrorMsg SID_ERR_GETINIKEYSTRING, errText$
  1528.      ERROR STFQUIT
  1529.  
  1530.       end if 
  1531.  
  1532.    elseif nullflag% <> FALSE then
  1533.  
  1534.       ErrorMsg SID_ERR_GETINIKEYSTRING, errText$
  1535.       ERROR STFQUIT
  1536.  
  1537.    else
  1538.       GetAbsPathFromIni = ""
  1539.    end if
  1540.  
  1541. END FUNCTION
  1542.  
  1543. PUBLIC FUNCTION MakePath (szDir$, szFile$) AS STRING
  1544. '** Purpose:
  1545. '**     Appends a file name to the end of a directory path,
  1546. '**     inserting a backslash character as needed.
  1547. '** Arguments:
  1548. '**     szDir$  - full directory path (with optional ending "\")
  1549. '**     szFile$ - filename to append to directory
  1550. '** Returns:
  1551. '**     Resulting fully qualified path name. (Lower Case)
  1552. '*************************************************************************
  1553.    DIM sz$
  1554.  
  1555.    IF szDir$ = "" THEN
  1556.       sz$ = szFile$
  1557.    ELSEIF szFile$ = "" THEN
  1558.       sz$ = szDir$
  1559. ''** HISHI - Aug/01/95
  1560.    ELSEIF LENBP(szFile$) > 12 THEN
  1561.       IF LENBP(szFile$) = 13 AND RIGHT$(szFile$,1) = "\" THEN
  1562.       sz$ = szDir$ + szFile$
  1563.       ELSE      
  1564. '       sz$ = ""
  1565.             sz$ = szDir$ + "\" + szFile$
  1566.       END IF
  1567.    ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  1568.       sz$ = szDir$ + szFile$
  1569.    ELSE
  1570.       sz$ = szDir$ + "\" + szFile$
  1571.    END IF
  1572.  
  1573.    IF sz$ <> "" THEN
  1574.       MakePath = LCASE$(sz$)
  1575.    ELSE
  1576.       MakePath = sz$
  1577.    END IF
  1578.  
  1579.     
  1580.  
  1581. END FUNCTION
  1582.  
  1583. PUBLIC FUNCTION Lot_MakeSizeString(size&) AS STRING
  1584. '** Purpose:
  1585. '** Author:
  1586. '** Arguments:
  1587. '** Returns:
  1588. '**     
  1589. '*************************************************************************
  1590.    Lot_MakeSizeString = STR$(size&) + gStrK$
  1591. END FUNCTION
  1592. '*************************************************************************
  1593.  
  1594. PUBLIC FUNCTION Lot_ExtractDriveLetter(destdir$) AS STRING
  1595. '** Purpose:
  1596. '** Author:
  1597. '** Arguments:
  1598. '** Returns:
  1599. '**     
  1600. '*************************************************************************
  1601.   Lot_ExtractDriveLetter = LCASE$(MID$(destdir$, 1, 1))
  1602. END FUNCTION
  1603. '*************************************************************************
  1604.  
  1605. PUBLIC FUNCTION Lot_ExtractDirectory(destdir$) AS STRING
  1606. '** Purpose:
  1607. '** Author:
  1608. '** Arguments:
  1609. '** Returns:
  1610. '**     
  1611. '*************************************************************************
  1612.   Lot_ExtractDirectory = LCASE$(MID$(destdir$, 3))
  1613. END FUNCTION
  1614. '*************************************************************************
  1615. PUBLIC SUB      Lot_CallWinhelp32 (prodno%, network$, SectionName$, DestDirSym$, FileName$) 
  1616. '** Purpose:Calls winhelp32 to build GIDs at reinstall.
  1617. '** Author:MZ
  1618. '** Arguments:prodno%, 
  1619. '                    network$, 
  1620. '                    SectionName$, 
  1621. '                    DestDirSym$, 
  1622. '                    FileName$
  1623. '*************************************************************************
  1624. DIM ExecError%,CopyDestDir$
  1625.    IF GetListItem(SYM_INSTALLKINDS$, prodno%) = gREINSTALL$ THEN
  1626.         IF network$ = gSTANDARD$ OR network$ = gNODE$ THEN
  1627.            IF (Lot_IsTheFeatureInstalled(SectionName$) = 1) THEN
  1628.               'CopyDestDir$ = GetSymbolValue(DestDirSym$)
  1629.               CopyDestDir$ = Lot_WhereIsFeature(prodno%, SectionName$, FileName$)
  1630.          '     ExecError% = WinExec ("winhlp32 -g "+CopyDestDir$+FileName$, SW_HIDE)
  1631.               ExecError% = WinExec ("winhlp32 -g "+CopyDestDir$+FileName$, SW_SHOW)
  1632.            END IF
  1633.         END IF
  1634.    END IF
  1635. END SUB
  1636.  
  1637.  
  1638. '** UNC stuff
  1639.  
  1640.  
  1641. PUBLIC SUB Lot_SplitUNCPath (szFullPath$, szVol$, szDirPath$)
  1642. '** Purpose:Splits a string into a UNC volume and a directory path
  1643. '** Author:GJL
  1644. '** Arguments:A path string, a string for the UNC vol
  1645. '**             a string for the resulting dir path
  1646. '** Returns:If UNC vol is invalid szVol will be empty
  1647. '**     
  1648. '*************************************************************************
  1649.    DIM StrOff&, tmp&
  1650.  
  1651.    StrOff& = INSTR( szFullPath$, "\\" )
  1652.    IF StrOff = 1 THEN
  1653.       StrOff& = INSTR( MID$(szFullPath$, 3), "\" )
  1654.       IF StrOff > 0 THEN
  1655.     tmp& = StrOff + 3
  1656.     StrOff& = StrOff + 3
  1657.     StrOff& = INSTR( MID$(szFullPath$, tmp&), "\" ) - 1
  1658.     IF StrOff& > 0 THEN
  1659.        StrOff& = StrOff& + tmp&
  1660.        szVol$ = LEFT$(szFullPath$, StrOff& - 1)
  1661.        szDirPath$ = MID$(szFullPath$, StrOff)
  1662.     ELSE
  1663.        szVol$ = szFullPath$
  1664.        szDirPath = ""
  1665.     END IF
  1666.       ELSE 
  1667.     szVol$ = ""
  1668.     szDirPath = ""
  1669.       END IF
  1670.    ELSE
  1671.    szVol$ = ""
  1672.    szDirPath$ = szFullPath$       
  1673.    END IF
  1674. END SUB
  1675. '** end UNC stuff
  1676.  
  1677. PUBLIC SUB Lot_SplitAnyPath (szFullPath$, szVol$, szDirPath$)
  1678. '** Purpose:Splits a string into a volume and a directory path
  1679. '** Author:
  1680. '** Arguments:A path string, a string for the vol
  1681. '**             a string for the resulting dir path
  1682. '** Returns: Volume and directory
  1683. '**     
  1684. '*************************************************************************
  1685.  
  1686.     If Lot_IsUnvalidatedUNCPath(szFullPath$) Then
  1687.         Lot_SplitUNCPath szFullPath$, szVol$, szDirPath$
  1688.     Else
  1689.         szVol$ = LEFT$(szFullPath$, 2)
  1690.         szDirPath$ = MID$(szFullPath$,3)
  1691.     End If
  1692. END SUB
  1693.  
  1694. '***********************************************************************
  1695. PUBLIC FUNCTION Lot_GetVol (szFullPath$)
  1696. '**  Description:  
  1697. '**      Return the volume whether it is UNC or local.
  1698. '**    
  1699. '**  Explicit Parameters:
  1700. '**       szFullPath$        The path from which to extract the path.
  1701. '**
  1702. '**  Implicit Parameters:
  1703. '**  Returns:  The volume.
  1704. '***********************************************************************
  1705.  
  1706.  
  1707.     DIM szVol$, szDirPath$
  1708.  
  1709.     Lot_SplitAnyPath szFullPath$, szVol$, szDirPath$
  1710.  
  1711.     Lot_GetVol = szVol$
  1712. END FUNCTION
  1713.  
  1714. '***********************************************************************
  1715. '**
  1716. '**  Name: ShowPathError
  1717. '**  Description:  
  1718. '**      Display a path error
  1719. '**    
  1720. '**  Explicit Parameters:
  1721. '**   nmsg&          The error message number to display. Use 0 if none
  1722. '**   nDescription%  The description of the message
  1723. '**   szPath$        The path with the problem
  1724. '**
  1725. '**  Out symbols:
  1726. '**    
  1727. '**  Implicit Parameters:
  1728. '**    
  1729. '***********************************************************************
  1730.  
  1731. PUBLIC SUB ShowPathError (nmsg%, nDescription%, szPath$)
  1732.    DIM sz$
  1733.  
  1734.    sz$ = CHR$(10) + CHR$(10) + "     " + szPath$
  1735.    sz$ = NullTrim$(sz$)
  1736.    IF nDescription% <> 0 THEN
  1737.       sz$ = sz$ + CHR$(10) + CHR$(10) + LdString(nDescription%)
  1738.    END IF
  1739.    ErrorMsg nmsg%, sz$
  1740.  
  1741. END SUB
  1742.  
  1743. '***********************************************************************
  1744. '**
  1745. '**  Name: ShowPathErrorNoDlgExit
  1746. '**  Description:  
  1747. '**      Display a path error and tell the dialog not to exit
  1748. '**    
  1749. '**  Explicit Parameters:
  1750. '**   nmsg&          The error message number to display. Use 0 if none
  1751. '**   nDescription&  The description of the message
  1752. '**   szPath$        The path with the problem
  1753. '**
  1754. '**  Out symbols:
  1755. '**   __LASTSTATUS   Set to "Q" to tell script not to quit   
  1756. '**    
  1757. '**  Implicit Parameters:
  1758. '**    
  1759. '***********************************************************************
  1760.  
  1761. PUBLIC SUB ShowPathErrorNoDlgExit (nmsg%, nDescription%, szPath$)
  1762.  
  1763.    ShowPathError nmsg%, nDescription%, szPath$
  1764.    SetListItem "__LASTSTATUS", 1, "Q"
  1765.  
  1766. END SUB
  1767.  
  1768. '***********************************************************************
  1769. '**
  1770. '**  Name: IsPathWritable
  1771. '**  Description:  
  1772. '**      Determine if we can write to a path.
  1773. '**    
  1774. '**  Explicit Parameters:
  1775. '**      szPath$     Pathname with no filename.
  1776. '**
  1777. '**  Out symbols:
  1778. '**    
  1779. '**  Implicit Parameters:
  1780. '**
  1781. '**  Returns: 1 if path is writable
  1782. '**    
  1783. '***********************************************************************
  1784.  
  1785.  
  1786. PUBLIC FUNCTION IsPathWritable (szPath$) AS INTEGER
  1787.  
  1788.    DIM sz$, cb%, i%, j%, uncVol& ,szUNC$, szDir$, szDrv$
  1789.  
  1790.    '** We can't check if the path is writable if the syntax is bad
  1791.     szDrv$ = CreateBuffer(10)
  1792.    IsPathWritable = 0
  1793.    uncVol& = 0
  1794.  
  1795.    Lot_SplitUNCPath szPath$, szUNC$, szDir$
  1796.    IF szUNC$ = "" THEN
  1797.     sz$ = szPath$
  1798.    ELSE
  1799.     uncVol& = FMapUNCVolume( szUNC$, szDrv$ )
  1800.     IF uncVol& = FALSE THEN
  1801.       IsPathWritable = FALSE
  1802.       EXIT FUNCTION
  1803.     END IF
  1804.     sz$ = NullTrim(szDrv$) + szDir$
  1805.    END IF
  1806.  
  1807.    IF Lot_CheckPath(szPath$) <> FALSE THEN
  1808.       '** Strip any trailing backslash
  1809.       IF cb% > 3 AND RIGHT$(sz$,1) = "\" THEN
  1810.      cb% = LEN(sz$)
  1811.      sz$ = MID$(sz$,1,(cb%-1))
  1812.       END IF
  1813.  
  1814.       '** Back through the directories until we find a directory that exists
  1815.       DO
  1816.      '** If the directory exists then return if the directory is writable
  1817.      IF LEN(sz$) <= 3 OR DoesDirExist(sz$) = 1 THEN
  1818.         IsPathWritable = IsDirWritable(sz$)
  1819.         IF IsPathWritable = FALSE THEN
  1820.               SetSymbolValue SYM_LAST_ERROR_SID$ , CStr(SID_DIR_READONLY)
  1821.             END IF
  1822.         EXIT DO
  1823.      END IF
  1824.  
  1825.      '** If dir does not exists then strip off the last dir and try again
  1826.      i% = INSTR(sz$,"\")
  1827.      IF i% = 0 THEN EXIT DO
  1828.      DO
  1829.         j% = INSTR((i%+1),sz$,"\")
  1830.         IF j% = 0 THEN
  1831.            IF i% = 3 THEN
  1832.           sz$ = MID$(sz$,1,3)        '** Handle root special
  1833.            ELSE
  1834.           sz$ = MID$(sz$,1,(i%-1))   '** Strip last directory
  1835.            END IF
  1836.            EXIT DO
  1837.         END IF
  1838.         i% = j%
  1839.      LOOP
  1840.       LOOP
  1841.    END IF
  1842.    IF uncVol& > 0 THEN
  1843.       uncVol& = FUnmapUNCVolume( szDrv$ )
  1844.    END IF
  1845. END FUNCTION
  1846.  
  1847. '***********************************************************************
  1848. '**
  1849. '**  Name: ValidatePath
  1850. '**  Description:  
  1851. '**      Determine if path is valid and display errors
  1852. '**
  1853. '**      THIS FUNCTION SHOULD ONLY BE USED FOR DESTINATION PATHS!!!
  1854. '**    
  1855. '**  Explicit Parameters:
  1856. '**      szPath$     Pathname with no filename
  1857. '**
  1858. '**  Out symbols:
  1859. '**    
  1860. '**  Implicit Parameters:
  1861. '**
  1862. '**  Returns: 1 if path is valid
  1863. '**    
  1864. '***********************************************************************
  1865.  
  1866. PUBLIC FUNCTION ValidatePath (szPath$) AS INTEGER
  1867.  
  1868.    DIM cch%, difflen% , notused&
  1869.    DIM volPath$, dirPath$, writable%, dirPathType$
  1870.  
  1871.    ValidatePath = FALSE
  1872.    if szPath$ = "" then 
  1873.       Exit Function
  1874.    End if
  1875. ''** HISHI - Aug/01/95
  1876.    cch% = LENBP(szPath$)
  1877.    difflen% = cch% + CINT(GetSymbolValue(SYM_DOSMAXPATHDIFF$))
  1878.    SetSymbolValue SYM_LAST_ERROR_SID$ , CStr(SID_ERR_DIRSYNTAXDESCRLONG)
  1879. '*** UNC stuff
  1880.    '** If it's a UNC path do some checks
  1881.  
  1882.    IF Lot_CleanPath(szPath$) = FALSE THEN
  1883.      ShowPathError SID_ERR_DIRSYNTAX,_
  1884.             CInt(GetSymbolValue(SYM_LAST_ERROR_SID$)), szPath$
  1885.      szPath$ = NullTrim$(szPath$)
  1886.      EXIT FUNCTION
  1887.    END IF
  1888.    
  1889.    IF Lot_IsUnvalidatedUNCPath(szPath$) = TRUE THEN
  1890.  
  1891.      Lot_SplitUNCPath szPath$, volPath$, dirPath$
  1892.  
  1893.      IF Lot_IsvalidUNCPath(volPath$) = FALSE THEN
  1894.        ShowPathError CInt(GetSymbolValue(SYM_LAST_ERROR_SID$)), 0, volPath$
  1895.  
  1896.      ELSEIF dirPath$ = "" OR Len(dirPath$) = 1 THEN
  1897.        ShowPathError SID_ERR_DIRSYNTAX, SID_ERR_DIRROOTDESCR, szPath$
  1898.  
  1899. '     ELSEIF Lot_CleanPath(szPath$) = FALSE THEN
  1900. '     ShowPathError SID_ERR_DIRSYNTAX,_
  1901. '            CInt(GetSymbolValue(SYM_LAST_ERROR_SID$)), szPath$
  1902.  
  1903. '** Make sure the path is not too long
  1904.      ELSEIF difflen% > MAX_DIR_PATH THEN
  1905.     '** This is only about the path length and might need a new message
  1906.        ShowPathError SID_ERR_PATHLEN, SID_ERR_PATHLEN_DESCR, _
  1907.             STR$(MAX_DIR_PATH - CINT(GetSymbolValue(SYM_DOSMAXPATHDIFF$)))+LdString(SID_ERR_PATHLEN_CHARS)
  1908.  
  1909.      ELSE
  1910.        SetSymbolValue SYM_LAST_ERROR_SID$ , CStr(SID_DIR_READONLY)
  1911.        writable% = IsPathWritable(szPath$)
  1912.        IF writable% = FALSE THEN
  1913.      ShowPathError CInt(GetSymbolValue(SYM_LAST_ERROR_SID$)), 0, szPath$
  1914.          ValidatePAth = FALSE
  1915.        ELSE
  1916.          ValidatePath = TRUE 
  1917.        END IF
  1918.      END IF
  1919. '*** end UNC stuff
  1920.    ELSE
  1921. '*** Check letter drives
  1922.       '** Make sure the drive is valid
  1923.       IF (MID$(szPath$,2,1) = ":" AND IsDriveValid(szPath$) = FALSE) THEN
  1924.     ShowPathError SID_DRV_NOTEXIST, 0, MID$(szPath$,1,2)
  1925.  
  1926.       '** Make sure the syntax of the path name is correct
  1927. '      ELSEIF Lot_CleanPath(szPath$) = FALSE THEN
  1928. '      ShowPathError SID_ERR_DIRSYNTAX,_
  1929. '             CInt(GetSymbolValue(SYM_LAST_ERROR_SID$)), szPath$
  1930.       '** Make sure not installing to the root
  1931.       ELSEIF (LEN(szPath$) = 2) OR (LEN(szPath$) = 3 _
  1932.          AND MID$(szPath$,3,1) = "\") THEN
  1933.     ShowPathError SID_ERR_DIRSYNTAX, SID_ERR_DIRROOTDESCR, szPath$
  1934.  
  1935.      '** Make sure the path is not too long
  1936.       ELSEIF difflen% > MAX_DIR_PATH THEN
  1937.     '** This is only about the path length and might need a new message
  1938.     ShowPathError SID_ERR_PATHLEN, SID_ERR_PATHLEN_DESCR, _
  1939.             STR$(MAX_DIR_PATH - CINT(GetSymbolValue(SYM_DOSMAXPATHDIFF$)))+LdString(SID_ERR_PATHLEN_CHARS)
  1940.       ELSE
  1941.     '** Make sure the path is writable
  1942.  
  1943.     writable% = IsPathWritable(szPath$)
  1944.     IF writable% = FALSE THEN
  1945.           SetSymbolValue SYM_LAST_ERROR_SID$ , CStr(SID_DIR_READONLY)
  1946.       ShowPathError CInt(GetSymbolValue(SYM_LAST_ERROR_SID$)), 0, szPath$
  1947.       ValidatePAth = FALSE
  1948.     ELSE
  1949.       ValidatePath = TRUE
  1950.     END IF
  1951.        END IF
  1952.    END IF
  1953.    szPath$ = NullTrim$(szPath$)
  1954. END FUNCTION
  1955.  
  1956. 'PUBLIC FUNCTION ValidateEditBox (hDlg&, Ctrl%) AS INTEGER
  1957. '** Purpose:check editbox text for valid volumes 
  1958. '** Author:
  1959. '** Arguments:
  1960. '** Returns:
  1961. '**     
  1962. '*************************************************************************
  1963. PUBLIC FUNCTION ValidateEditBox (hDlg&, Ctrl%) AS INTEGER
  1964.    DIM  eb$, vol$, path$, editbox$, combobox$, comboId%
  1965.  
  1966.    comboBox = "IDC_COMBO"+Right$(Str$(Ctrl%),1)
  1967.    editBox = "IDC_EDIT"+Right$(Str$(Ctrl%),1)
  1968.    comboId% = Ctrl% + 400
  1969. '**CB_GETCURSEL = 0x147 = 327
  1970.    ValidateEditBox = 1 + SendMessage(GetDlgItem(hDlg&,comboId%), 327, 0, 0)
  1971.    eb$=GetListItem("IDC_EDIT",Ctrl%)
  1972.    Lot_SplitUNCPath eb$, vol$, path$
  1973.    IF NOT vol$ = "" THEN
  1974. '** There is a UNC path in the edit box
  1975.       IF ValidatePath(eb$) = FALSE THEN
  1976.         ValidateEditBox = FALSE
  1977.         EXIT FUNCTION
  1978.       END IF
  1979.       ValidateEditBox = SelectDriveCombo(combobox, vol$)
  1980.       IF ValidateEditBox = 0 THEN
  1981.         ShowPathError CInt(GetSymbolValue(SYM_LAST_ERROR_SID$)), 0, vol$
  1982.       END IF
  1983.       EXIT FUNCTION
  1984.    ELSE
  1985.       IF MID$(eb$,2,1) = ":" THEN
  1986. '** There is a drive letter in the edit box
  1987.      ValidateEditBox = SelectDriveCombo (comboBox, eb$)
  1988.      IF ValidateEditBox = 0 THEN
  1989.         ShowPathError SID_DRV_NOTEXIST, 0, Left$(eb$,2)
  1990.      ELSE
  1991.         SetListItem "IDC_EDIT", Ctrl%, Lot_ExtractDirectory(eb$)
  1992.         AddListItem SYM_UPDATELIST$, editBox
  1993.      END IF
  1994.       ELSE 
  1995.      IF MID$(eb$,1,1) <> "\" THEN
  1996.         SetListItem "IDC_EDIT", Ctrl%, "\"+eb$
  1997.         AddListItem SYM_UPDATELIST$, editBox
  1998.       
  1999.      END IF
  2000.       END IF
  2001.    END IF
  2002. END FUNCTION
  2003.  
  2004. 'PUBLIC FUNCTION ValidateBrowse (hDlg&, Ctrl%) AS INTEGER
  2005. '** Purpose:check browse results text for valid volumes 
  2006. '** Author:
  2007. '** Arguments:
  2008. '** Returns:
  2009. '**     
  2010. '*************************************************************************
  2011. PUBLIC FUNCTION ValidateBrowse (hDlg&, Ctrl%) AS INTEGER
  2012.    DIM  eb$, vol$, path$, editbox$, combobox$, comboId%
  2013.  
  2014.    comboBox = "IDC_COMBO"+Right$(Str$(Ctrl%),1)
  2015.    editBox = "IDC_EDIT"+Right$(Str$(Ctrl%),1)
  2016.    comboId% = Ctrl% + 400
  2017. '**CB_GETCURSEL = 0x147 = 327
  2018.    ValidateBrowse = 1 + SendMessage(GetDlgItem(hDlg&,comboId%), 327, 0, 0)
  2019.    eb$=GetSymbolValue("SYM_BROWSE_RESULT")
  2020.    Lot_SplitUNCPath eb$, vol$, path$
  2021.    IF NOT vol$ = "" THEN
  2022.       IF ValidatePath(eb$) = FALSE THEN
  2023.         ValidateBrowse = FALSE
  2024.         EXIT FUNCTION
  2025.       END IF
  2026.       ValidateBrowse = SelectDriveCombo(combobox, vol$)
  2027.       IF ValidateBrowse = 0 THEN
  2028.         ShowPathError CInt(GetSymbolValue(SYM_LAST_ERROR_SID$)), 0, vol$
  2029.       ELSE
  2030.     SetListItem "IDC_EDIT", Ctrl%, eb$
  2031.     AddListItem SYM_UPDATELIST$, editBox
  2032.       END IF
  2033.       EXIT FUNCTION
  2034.    ELSE
  2035.       IF MID$(eb$,2,1) = ":" THEN
  2036.      ValidateBrowse = SelectDriveCombo (comboBox, eb$)
  2037.      IF ValidateBrowse = 0 THEN
  2038.         ShowPathError SID_DRV_NOTEXIST, 0, Left$(eb$,2)
  2039.      ELSE
  2040.         SetListItem "IDC_EDIT", Ctrl%, Lot_ExtractDirectory(eb$)
  2041.         AddListItem SYM_UPDATELIST$, editBox
  2042.      END IF
  2043.       ELSE 
  2044.      IF MID$(eb$,1,1) <> "\" THEN
  2045.         SetListItem "IDC_EDIT", Ctrl%, "\"+eb$
  2046.         AddListItem SYM_UPDATELIST$, editBox
  2047.       
  2048.      END IF
  2049.       END IF
  2050.    END IF
  2051. END FUNCTION
  2052.  
  2053.  
  2054.  
  2055.  
  2056. PUBLIC FUNCTION Lot_Dir  (szDir$) AS STRING
  2057. '** Purpose:
  2058. '** Author:
  2059. '** Arguments:
  2060. '** Returns:
  2061. '**     
  2062. '*************************************************************************
  2063.     DIM DirRet$
  2064.  
  2065.     DirRet$ = Dir$(szDir$)
  2066.     Lot_Dir = DirRet$
  2067. END FUNCTION
  2068.  
  2069. PUBLIC FUNCTION Lot_GetLocalHardDrive(ProdSize&,DefaultDir$) AS STRING
  2070. '** Purpose:
  2071. '**     Gets the first writable local hard disk with enough space e.g. D:
  2072. '** Arguments:
  2073. '**     ProdSize& the minimum size requirements for installing a product
  2074. '**     DefaultDir$  the default directory to install to
  2075. '** Returns:
  2076. '**     D:\ + DefaultDir$ or an empty string
  2077. '*************************************************************************
  2078.    DIM Length%, count%, lDrive$, SpaceAvail&
  2079.  
  2080.    Lot_GetLocalHardDrive = ""
  2081.    Length% = GetListLength(SYM_LOCALHARDDRIVES$)
  2082.     IF Length% = 0 THEN
  2083.        GetLocalHardDrivesList SYM_LOCALHARDDRIVES$
  2084.        Length% = GetListLength(SYM_LOCALHARDDRIVES$)
  2085.     END IF
  2086.    FOR count% = 1 TO Length%
  2087.       lDrive$     = GetListItem(SYM_LOCALHARDDRIVES$, count%)
  2088.       SpaceAvail& = GetFreeSpaceForDrive(lDrive$)
  2089.       lDrive$     = lDrive$ + ":\" + DefaultDir$
  2090.       IF SpaceAvail& > (ProdSize& \ 1024) AND IsDirWritable(lDrive$) THEN
  2091.      Lot_GetLocalHardDrive = LCASE$(lDrive$)
  2092.      EXIT FUNCTION
  2093.       END IF
  2094.    NEXT
  2095.  
  2096. END FUNCTION
  2097.  
  2098. PUBLIC FUNCTION Lot_GetNetHardDrive(ProdSize&,DefaultDir$) AS STRING
  2099. '** Purpose:
  2100. '**     Gets the first writable network hard disk with enough space e.g. D:
  2101. '** Arguments:
  2102. '**     ProdSize& the minimum size requirements for installing a product
  2103. '**     DefaultDir$  the default directory to install to
  2104. '** Returns:
  2105. '**     D:\ + DefaultDir$ or an empty string
  2106. '*************************************************************************
  2107.    DIM Length%, count%, lDrive$, SpaceAvail&
  2108.  
  2109.    Lot_GetNetHardDrive = ""
  2110.    GetNetworkDrivesList SYM_NETHARDDRIVES$
  2111.    Length% = GetListLength(SYM_NETHARDDRIVES$)
  2112.    FOR count% = 1 TO Length%
  2113.       lDrive$     = GetListItem(SYM_NETHARDDRIVES$, count%)
  2114.       SpaceAvail& = GetFreeSpaceForDrive(lDrive$)
  2115.       lDrive$     = lDrive$ + ":\" + DefaultDir$
  2116.       IF SpaceAvail& > (ProdSize& \ 1024) AND IsDirWritable(lDrive$) THEN
  2117.      Lot_GetNetHardDrive = LCASE$(lDrive$)
  2118.      EXIT FUNCTION
  2119.       END IF
  2120.    NEXT
  2121.  
  2122. END FUNCTION
  2123.  
  2124. PUBLIC FUNCTION Lot_GetAllHardDrive(ProdSize&,DefaultDir$) AS STRING
  2125. '** Purpose:
  2126. '**     Gets the first writable local or network hard disk with enough 
  2127. '**     space e.g. D:
  2128. '** Arguments:
  2129. '**     ProdSize& the minimum size requirements for installing a product
  2130. '**     DefaultDir$  the default directory to install to
  2131. '** Returns:
  2132. '**     D:\ + DefaultDir$ or an empty string
  2133. '*************************************************************************
  2134.  
  2135.    DIM   drv$
  2136.  
  2137.    drv$ = Lot_GetLocalHardDrive(ProdSize&, DefaultDir$)
  2138.    IF drv$ <> "" THEN
  2139.       Lot_GetAllHardDrive = drv$
  2140.    ELSE
  2141.       Lot_GetAllHardDrive = Lot_GetNetHardDrive(ProdSize&, DefaultDir$)
  2142.    END IF
  2143.  
  2144. END FUNCTION
  2145.  
  2146. PUBLIC FUNCTION Lot_GetChapterFromKeyword (szKeyword$) AS STRING
  2147. '** Purpose: Get the chapter # given the Chapter name
  2148. '** Author:
  2149. '** Arguments:
  2150. '** Returns:
  2151. '**     
  2152. '*************************************************************************
  2153.     DIM g_strbuf$
  2154.  
  2155.     g_strbuf$ = CreateBuffer(256)
  2156.     If FGetChapterFromKeyword(szKeyword$, g_strbuf$, 256) = 0 Then
  2157.        Lot_GetChapterFromKeyword = ""
  2158.     Else
  2159.        Lot_GetChapterFromKeyword = NullTrim(g_strbuf$)
  2160.     End If
  2161. END FUNCTION
  2162.  
  2163. PUBLIC Lot_CallExec_RC$ 
  2164.  
  2165. PUBLIC FUNCTION Lot_CallProductFunctions (func_name$, BYVAL direction$, always%, back$, parms$) AS STRING
  2166. '** Purpose:
  2167. '** Author:
  2168. '** Arguments:
  2169. '**     func_name$: Name of function + prod Acronym will be called.
  2170. '**     always%: IF TRUE then alwasy calls function, otherwise only if product is turned on.
  2171. '**     direction$: determines the direction: gBACK means start at the last callback.
  2172. '** Returns:
  2173. '**     
  2174. '*************************************************************************
  2175.   DIM n%, i%, lname$, prodcall$, notused%, incr%
  2176.  
  2177.   Lot_CallProductFunctions = ""
  2178.   n% = Reg_GetNumberOfProducts()
  2179.   If direction$ = gBACK Then
  2180.     i% = n%
  2181.     incr% = 1
  2182.   Else
  2183.     i% = 1
  2184.     incr% = -1
  2185.   End If
  2186.   WHILE (i%  >= 1 AND i% <= n%)
  2187.  
  2188.      lname$ = Reg_GetProductAcronym(i%)
  2189.      If lname$ <> "" AND (always% <> FALSE OR Prods(i%).UIInOrOut <> FALSE) Then
  2190.             '
  2191.             ' construct a lotus script statement for EXECUTE. It will look
  2192.             ' something like this:
  2193.             '     INIT123(i%, "server$", parms$)
  2194.             '
  2195.     If parms$ <> "" Then
  2196.        prodcall$ = "Lot_CallExec_RC$  = " & func_name$ & lname$ & "(" & i% & "," & |"| & GetSymbolValue(SYM_NETWORK) & |"| & "," & |"| & direction$ & |"| &  "," & parms$ & ")"
  2197.     Else
  2198.        prodcall$ = "Lot_CallExec_RC$  = " & func_name$ & lname$ & "(" & i% & "," & |"| &  GetSymbolValue(SYM_NETWORK) & |"| & "," & |"| & direction$ & |"| & ")"
  2199.     End If
  2200.      ' DOEXEC removed and replaced by EXECUTE!
  2201.             ' call DOEXEC, which acts like the script EXECUTE statement.
  2202.             ' The difference is that DOEXEC operates in the default module,
  2203.             ' while  EXECUTE creates a temporary module that disappears once the
  2204.             ' call is made.  The first parameter to DOEXEC is a module name,
  2205.             ' which is made into a "USE modname" statement, if that module 
  2206.             ' name has not yet been USE'd via DOEXEC. The second arg is the
  2207.             ' statement to be run. Note - the args must be call by value,
  2208.             ' not reference (can be done by enclosing args in parens)       
  2209.  
  2210.           gEndStatementEncountered% = FALSE
  2211.     '** TV : old execute : on error doesn't work
  2212.     'EXECUTE(|USE "| & lname$ & |" : | & prodcall$)
  2213.     '** TV : new 
  2214.     EXECUTE(|USE "| & lname$ & |" : SUB INITIALIZE : | & prodcall$ & |:END SUB|)
  2215.  
  2216.           '  this gEndStatementEncountered flag is necessary because the Lotus
  2217.           '  END statement, which normally exists the entire program, only
  2218.     '  exits the top-level routine running in DOEXEC.  So,
  2219.           '  check this flag here, to see if we hit an END during DOEXEC.
  2220.  
  2221.           IF gEndStatementEncountered% = TRUE THEN
  2222.             END                                            ' exit the program
  2223.           END IF
  2224.  
  2225.     direction$ = Lot_CallExec_RC$
  2226.     If direction$ = gBACK Then
  2227.        incr% = -1
  2228.     Else
  2229.        incr% = 1
  2230.     End If
  2231.      End If
  2232.  
  2233.      If direction$ = gBACK AND back$ = gALLPRODUCTS then
  2234.        Lot_CallProductFunctions = direction$
  2235.        Exit Function
  2236.      End If
  2237.  
  2238.      i% = i% + incr%
  2239.   WEND
  2240.  
  2241.   Lot_CallProductFunctions = direction$
  2242.  
  2243. END FUNCTION
  2244.  
  2245. PUBLIC FUNCTION Lot_CallOneProductFunction (prodno%, func_name$, BYVAL direction$, always%, parms$) AS STRING
  2246. '** Purpose:
  2247. '** Author:
  2248. '** Arguments:
  2249. '** Returns:
  2250. '**     
  2251. '*************************************************************************
  2252.   DIM lname$, prodcall$, notused%
  2253.  
  2254.   Lot_CallOneProductFunction = ""
  2255.   lname$ = Reg_GetProductAcronym(prodno%)
  2256.   If lname$ <> "" Then
  2257.      '
  2258.      ' construct a lotus script statement for EXECUTE. It will look
  2259.      ' something like this:
  2260.      '     USE "123":INIT123(prodno%, "server$", parms$)
  2261.      '
  2262.      If parms$ <> "" Then
  2263.     prodcall$ = "Lot_CallExec_RC$  = " & func_name$ & lname$ & "(" & prodno% & "," & |"| & GetSymbolValue(SYM_NETWORK) & |"| & "," & |"| & direction$ & |"| & "," & parms$ & ")"
  2264.      Else
  2265.     prodcall$ = "Lot_CallExec_RC$  = " & func_name$ & lname$ & "(" & prodno% & "," & |"| &  GetSymbolValue(SYM_NETWORK) & |"| & "," & |"| & direction$ & |"| & ")"
  2266.      End If
  2267.  
  2268.      ' DOEXEC removed and replaced by EXECUTE!
  2269.             ' call DOEXEC, which acts like the script EXECUTE statement.
  2270.             ' The difference is that DOEXEC operates in the default module,
  2271.             ' while  EXECUTE creates a temporary module that disappears once the
  2272.             ' call is made.  The first parameter to DOEXEC is a module name,
  2273.             ' which is made into a "USE modname" statement, if that module 
  2274.             ' name has not yet been USE'd via DOEXEC. The second arg is the
  2275.             ' statement to be run. Note - the args must be call by value,
  2276.             ' not reference (can be done by enclosing args in parens)       
  2277.             
  2278.        gEndStatementEncountered% = FALSE            ' see Lot_CallProductFunctions
  2279.  
  2280.       '** TV : old execute : on error doesn't work
  2281.       'EXECUTE(|USE "| & lname$ & |" : | & prodcall$)
  2282.       '** TV : new 
  2283.       EXECUTE(|USE "| & lname$ & |" : SUB INITIALIZE : | & prodcall$ & |:END SUB|)
  2284.     
  2285.  
  2286.        IF gEndStatementEncountered% = TRUE THEN
  2287.             END                                            ' exit the program
  2288.        END IF
  2289.  
  2290.      Lot_CallOneProductFunction = Lot_CallExec_RC$
  2291.  
  2292.  
  2293.   End If
  2294.  
  2295.  
  2296. END FUNCTION
  2297.  
  2298. '*************************************************************************
  2299. PUBLIC FUNCTION Lot_CheckPath (path$) AS INTEGER
  2300. '** Purpose:
  2301. '** Author:
  2302. '** Arguments:
  2303. '** Returns:
  2304. '**     
  2305. '*************************************************************************
  2306.    DIM ldrive$, vol$, unused$
  2307.  
  2308.    Lot_CheckPath = FALSE
  2309.    path$ = NullTrim( path$ )
  2310.    IF path$ <> "" THEN
  2311.       Lot_SplitUNCPath path$, vol$, unused$
  2312.       IF vol$ = "" THEN
  2313.        ldrive$ = Lot_ExtractDriveLetter(path$)
  2314.  
  2315.        IF IsDriveValid(ldrive$) <> FALSE AND Lot_CleanPath(path$) <> FALSE THEN 
  2316.            Lot_CheckPath = TRUE
  2317.        END IF
  2318.       ELSE
  2319.        IF Lot_CleanPath(path$) <> FALSE THEN 
  2320.         Lot_CheckPath = TRUE
  2321.        END IF
  2322.       END IF
  2323.    END IF
  2324.  
  2325. END FUNCTION
  2326.  
  2327. PUBLIC FUNCTION Lot_GetFirst (szChapt$, nFlag%) AS STRING
  2328. '** Purpose:
  2329. '** Author:
  2330. '** Arguments:
  2331. '** Returns:
  2332. '**     
  2333. '*************************************************************************
  2334.   DIM g_strbuf$, Length%
  2335.  
  2336.   g_strbuf$ = CreateBuffer(256)
  2337.   if FGetFirst(szChapt$,g_strbuf$,CLng(nFlag%)) = 0 then
  2338.       Lot_GetFirst = ""     
  2339.   else
  2340.      Lot_GetFirst = NullTrim(g_strbuf)
  2341.  end if
  2342.  
  2343.  
  2344. END FUNCTION
  2345. '*************************************************************
  2346.  
  2347. PUBLIC FUNCTION Lot_GetNext () AS STRING
  2348. '** Purpose:
  2349. '** Author:
  2350. '** Arguments:
  2351. '** Returns:
  2352. '**     
  2353. '*************************************************************************
  2354.       DIM g_strbuf$
  2355.   
  2356.     g_strbuf$ = CreateBuffer(256)
  2357.     if FGetNext(g_strbuf$) = 0 then
  2358.        Lot_GetNext = ""         
  2359.     else
  2360.        Lot_GetNext = NullTrim(g_strbuf$)
  2361.      end if
  2362.  
  2363. END FUNCTION
  2364. '*************************************************************************
  2365.  
  2366. PUBLIC FUNCTION Lot_SetDateOfFile (szFile$, szDate$) AS INTEGER
  2367. '** Purpose:
  2368. '** Author:
  2369. '** Arguments:
  2370. '** Returns:
  2371. '**     
  2372. '*************************************************************************
  2373.   if FSetDateOfFile(szFile$,szDate$) = 0 then
  2374.     Lot_SetDateOfFile = 0   
  2375.   else
  2376.      Lot_SetDateOfFile = 1
  2377.   end if
  2378.  
  2379.  
  2380. END FUNCTION
  2381. '*************************************************************
  2382.  
  2383. PUBLIC SUB Lot_RemoveSectionFilesFromCopyList (szSect$) 
  2384. '** Purpose:
  2385. '** Author:
  2386. '** Arguments:
  2387. '** Returns:
  2388. '**     
  2389. '*************************************************************************
  2390. %rem
  2391.     if FValidInfSect(szSect$) = 0 then
  2392.     n% = 1
  2393.     else
  2394.     n% = 0
  2395.     end if
  2396.     if n% > 0 then
  2397.     BadArgErr n%, "Lot_RemoveSectionFilesFromCopyList", szSect$
  2398.     end if
  2399. %endrem ''DEBUG
  2400.  
  2401.     IF FRemoveSectionFilesFromCopyList (szSect$) = 0 THEN
  2402.     ErrorMsg SID_ERR_LOT_RSFFCL, ""
  2403.     ERROR STFQUIT
  2404.     END IF
  2405. END SUB
  2406. '*************************************************************************
  2407.  
  2408. PUBLIC SUB Lot_RemoveSectionKeyFileFromCopyList (szSect$, szKey$) 
  2409. '** Purpose:
  2410. '** Author:
  2411. '** Arguments:
  2412. '** Returns:
  2413. '**     
  2414. '*************************************************************************
  2415. %rem
  2416.     if FValidInfSect(szSect$) = 0 then
  2417.     n% = 1
  2418.     elseif szKey$ = "" then
  2419.     n% = 2
  2420.     else
  2421.     n% = 0
  2422.     end if
  2423.     if n% > 0 then
  2424.     BadArgErr n%, "Lot_RemoveSectionKeyFileFromCopyList", szSect$+", "+szKey$
  2425.     end if
  2426. %endrem ''DEBUG
  2427.  
  2428.     IF FRemoveSectionKeyFileFromCopyList (szSect$, szKey$) = 0 THEN
  2429.     ErrorMsg SID_ERR_LOT_RSKFFCL, ""
  2430.     ERROR STFQUIT
  2431.     END IF
  2432. END SUB
  2433. '*************************************************************************
  2434.  
  2435. PUBLIC FUNCTION Lot_GetInfSectionSize (szSect$)  AS LONG
  2436. '** Purpose:
  2437. '** Author:
  2438. '** Arguments:
  2439. '** Returns:
  2440. '**     
  2441. '*************************************************************************
  2442. %rem
  2443.     if FValidInfSect(szSect$) = 0 then
  2444.     n% = 1
  2445.     else
  2446.     n% = 0
  2447.     end if
  2448.     if n% > 0 then
  2449.     ERROR STFQUIT
  2450.     end if
  2451. %endrem
  2452.     Lot_GetInfSectionSize = LcbGetInfSectionSize(szSect$)
  2453. END FUNCTION
  2454.  
  2455. '** DND: These functions need an ASSERT!!!!!!!
  2456.  
  2457. PUBLIC FUNCTION Lot_AddPagetoNotebook (hDlg&,  Notebookid&,DlgId%, Tabstring$)   AS INTEGER
  2458. '** Purpose:
  2459. '** Author:
  2460. '** Arguments:
  2461. '** Returns:
  2462. '**     
  2463. '*************************************************************************
  2464.     DIM Dll$
  2465.     Dll$ = FindResourceinDLL (CLng(DlgId%), RT_DIALOG)
  2466.     If Dll$ = "" then
  2467.         Dll$ = "mscuistf.dll"
  2468.     End if
  2469.     Lot_AddPagetoNotebook = NotebookAddDlgPage(hDlg&,  Notebookid&,CLng(DlgId%), Dll$,FNAMEORGDLGPROC$,Tabstring$) 
  2470.     IF Lot_AddPagetoNotebook = 0 THEN
  2471.        ErrorMsg 0, "Error creating notebook page"
  2472.       ERROR STFQUIT
  2473.     END IF
  2474. END FUNCTION
  2475. '*************************************************************************
  2476.  
  2477. PUBLIC FUNCTION Lot_NotebookPageView (hDlg&,  Notebookid&, DlgId%, fShowPage%) AS INTEGER
  2478. '** Purpose:
  2479. '** Author:
  2480. '** Arguments:
  2481. '** Returns:
  2482. '**     
  2483. '*************************************************************************
  2484.    Lot_NotebookPageView = FNotebookPageView (hDlg&,  Notebookid&, CLng(DlgId%), CLng(fShowPage%))
  2485.    IF Lot_NotebookPageView = 0 THEN
  2486.       ErrorMsg 0, "Error viewing notebook page"
  2487.       ERROR STFQUIT
  2488.    END IF
  2489. END FUNCTION
  2490. '*************************************************************************
  2491.  
  2492. PUBLIC SUB Lot_TurnToPage (hDlg&,Notebookid&, pageid%) 
  2493. '** Purpose:
  2494. '** Author:
  2495. '** Arguments:
  2496. '** Returns:
  2497. '**     
  2498. '*************************************************************************
  2499.     IF  FNotebookTurnToPage(hDlg&,Notebookid&, CLng(pageid%)) <> 1 THEN
  2500.        ErrorMsg 0, "Error turning notebook page"
  2501.       ERROR STFQUIT
  2502.     END IF
  2503. END SUB
  2504. '*************************************************************************
  2505.  
  2506. PUBLIC FUNCTION Lot_GetPagehandle  (hDlg&,Notebookid&,Pageid%) AS LONG
  2507. '** Purpose:
  2508. '** Author:
  2509. '** Arguments:
  2510. '** Returns:
  2511. '**     
  2512. '*************************************************************************
  2513.     Lot_GetPagehandle = NotebookGetPageHwnd(hDlg&,Notebookid&,CLng(Pageid%)) 
  2514.     IF Lot_GetPagehandle = 0 THEN
  2515.        ErrorMsg 0, "Error getting the notebook page handle"
  2516.        ERROR STFQUIT
  2517.     END IF
  2518. END FUNCTION
  2519. '*************************************************************************
  2520.  
  2521. PUBLIC SUB Lot_LCBResetContent(hDlg&)
  2522. '** Purpose:
  2523. '** Author:
  2524. '** Arguments:
  2525. '** Returns:
  2526. '**     
  2527. '*************************************************************************
  2528.   LCBResetContent hDlg&
  2529. END SUB
  2530. '*************************************************************************
  2531.  
  2532. PUBLIC SUB Lot_LCBSetRedraw (hDlg&, fRedraw%)
  2533. '** Purpose:
  2534. '** Author:
  2535. '** Arguments:
  2536. '** Returns:
  2537. '**     
  2538. '*************************************************************************
  2539.   LCBSetRedraw hDlg&, CLng(fRedraw%)
  2540. END SUB
  2541. '*************************************************************************
  2542.  
  2543. PUBLIC FUNCTION Lot_LCBGetCount (hDlg&) AS INTEGER
  2544.  
  2545. '** Purpose:
  2546. '** Author:
  2547. '** Arguments:
  2548. '** Returns:
  2549. '**     
  2550. '*************************************************************************
  2551.  
  2552.    Lot_LCBGetCount = LCBGetCount(hDlg&)
  2553.  
  2554. END FUNCTION
  2555. '*************************************************************************
  2556.  
  2557. PUBLIC FUNCTION Lot_LCBAddItem (hDlg&, item$) AS INTEGER
  2558. '** Purpose:
  2559. '** Author:
  2560. '** Arguments:
  2561. '** Returns:
  2562. '**     
  2563. '*************************************************************************
  2564.      DIM rc%
  2565.  
  2566.    rc% = LCBAddItem (hDlg&, item$)
  2567.    If (rc% = 0) Then
  2568.       ErrorMsg 0, "Could not Add Item: "+item$+" to LCB on DLG: "+STR$(hDlg&)
  2569.       ERROR STFQUIT
  2570.    End If
  2571.    Lot_LCBAddItem= rc%
  2572.  
  2573. END FUNCTION
  2574. '*************************************************************************
  2575.  
  2576. PUBLIC FUNCTION Lot_LCBReplaceItem (hDlg&, index%, itemnum%, item$) AS INTEGER
  2577. '** Purpose:
  2578. '** Author:
  2579. '** Arguments:
  2580. '** Returns:
  2581. '**     
  2582. '*************************************************************************
  2583.    DIM rc%
  2584.  
  2585.    rc% = LCBReplaceItem (hDlg&, CLng(index%), CLng(itemnum%), item$)
  2586.    Lot_LCBReplaceItem = rc%
  2587.  
  2588. END FUNCTION
  2589. '*************************************************************************
  2590.  
  2591. PUBLIC FUNCTION Lot_LCBGetItem (hDlg&, index%, itemnum%) AS STRING
  2592. '** Purpose:
  2593. '** Author:
  2594. '** Arguments:
  2595. '** Returns:
  2596. '**???     
  2597. '*************************************************************************
  2598. DIM rc%
  2599. DIM szValue As String : szValue = CreateBuffer(cbSymValMax)
  2600.  
  2601.      rc% = LCBGetItem (hDlg&, CLng(index%), CLng(itemnum%), szValue$, cbSymValMax)
  2602.      Lot_LCBGetItem = NullTrim(szValue$)
  2603.  
  2604. END FUNCTION
  2605. '*************************************************************************
  2606.  
  2607. PUBLIC FUNCTION Lot_LCBToggleItem  (hDlg&, index%) AS INTEGER
  2608. '** Purpose:
  2609. '** Author:
  2610. '** Arguments:
  2611. '** Returns:
  2612. '**     
  2613. '*************************************************************************
  2614.    DIM rc%
  2615.  
  2616.    rc% = LCBToggleItem (hDlg&, CLng(index%))
  2617.    Lot_LCBToggleItem = rc%
  2618.  
  2619. END FUNCTION
  2620.  
  2621. '*************************************************************************
  2622.  
  2623. PUBLIC SUB Lot_LCBSetSel (hDlg&, index%)
  2624. ' wrapper 
  2625. '*************************************************************************
  2626.   LCBSetSel hDlg&, CLng(index%)
  2627. END SUB
  2628.  
  2629. '*************************************************************************
  2630.  
  2631. PUBLIC SUB Lot_LCBSetTabs (hDlg&, t1%, t2%, t3%, t4%)
  2632. ' wrapper 
  2633. '*************************************************************************
  2634.   LCBSetTabs hDlg&, CLng(t1%), CLng(t2%), CLng(t3%), CLng(t4%)
  2635. END SUB
  2636.  
  2637. '*************************************************************************
  2638.  
  2639. PUBLIC FUNCTION Lot_GetFirstChild (szChapt$, nFlag%) AS STRING
  2640. '** Purpose:
  2641. '** Author:
  2642. '** Arguments:
  2643. '** Returns:
  2644. '**     
  2645. '*************************************************************************
  2646. DIM szValue As String : szValue = CreateBuffer(cbSymValMax)
  2647.  
  2648.     if FGetFirstChild(szChapt$, szValue$, CLng(nFlag%)) = 0 then
  2649.      Lot_GetFirstChild = ""         
  2650.     else
  2651.      Lot_GetFirstChild = NullTrim(szValue$ )
  2652.     end if
  2653.  
  2654. END FUNCTION
  2655. '*************************************************************************
  2656.  
  2657. PUBLIC FUNCTION Lot_GetGroupName ( szGroupFileName$) AS STRING  
  2658. '** Purpose:
  2659. '** Author:
  2660. '** Arguments:
  2661. '** Returns:
  2662. '**     
  2663. '*************************************************************************
  2664.    DIM szValue As String : szValue = CreateBuffer(cbSymValMax)
  2665.  
  2666.    IF FGetGroupName(szGroupFileName$, szValue$, cbSymValMax) = 0 THEN
  2667.       Lot_GetGroupName = ""
  2668.    ELSE
  2669.       Lot_GetGroupName = NullTrim(szValue$)
  2670.    END IF
  2671.  
  2672. END FUNCTION
  2673. '*************************************************************************
  2674.  
  2675. PUBLIC FUNCTION Lot_GetChapterValStr (szChapter$, nField%)  AS STRING 
  2676. '** Purpose:
  2677. '** Author:
  2678. '** Arguments:
  2679. '** Returns:
  2680. '**     
  2681. '*************************************************************************
  2682.    DIM szValue As String : szValue = CreateBuffer(cbSymValMax)
  2683.  
  2684.    IF FGetChapterValStr(szChapter$, CLng(nField%), szValue$, cbSymValMax) = 0 THEN
  2685.       Lot_GetChapterValStr = ""
  2686.    ELSE
  2687.       Lot_GetChapterValStr = NullTrim(szValue$)
  2688.    END IF
  2689.  
  2690. END FUNCTION
  2691. '*************************************************************************
  2692.  
  2693. PUBLIC FUNCTION Lot_GetChapterValInt (szChapter$,nField%) AS INTEGER  
  2694. '** Purpose:
  2695. '** Author:
  2696. '** Arguments:
  2697. '** Returns:
  2698. '**     
  2699. '*************************************************************************
  2700.    DIM lpVal&
  2701.    
  2702.    if FGetChapterValInt(szChapter$, CLng(nField%),lpVal&) = 0 then
  2703.        Lot_GetChapterValInt = -1    
  2704.    else
  2705.       Lot_GetChapterValInt = CInt(lpVal&)
  2706.    end if
  2707.  
  2708. END FUNCTION
  2709. '*************************************************************************
  2710.  
  2711. PUBLIC FUNCTION Lot_GetNextSibling (szChapter$,nField%) AS STRING
  2712. '** Purpose:
  2713. '** Author:
  2714. '** Arguments:
  2715. '** Returns:
  2716. '**     
  2717. '*************************************************************************
  2718. DIM szValue As String : szValue = CreateBuffer(cbSymValMax)
  2719.  
  2720.     if FGetNextSibling(szChapter$, szValue$,CLng(nField%)) = 0 then
  2721.        Lot_GetNextSibling = ""  
  2722.     else
  2723.        Lot_GetNextSibling = NullTrim(szValue$)
  2724.     end if
  2725.  
  2726. END FUNCTION
  2727. '*************************************************************************
  2728.  
  2729. PUBLIC FUNCTION Lot_GetNextChild () AS STRING
  2730. '** Purpose:
  2731. '** Author:
  2732. '** Arguments:
  2733. '** Returns:
  2734. '**     
  2735. '*************************************************************************
  2736.    DIM g_strbuf$, Length%
  2737.  
  2738.    g_strbuf$ = CreateBuffer(256)
  2739.    if FGetNextChild(g_strbuf$) = 0 then
  2740.       Lot_GetNextChild = ""     
  2741.    else
  2742.       Lot_GetNextChild = NullTrim(g_strbuf$)
  2743.     end if
  2744.  
  2745. END FUNCTION
  2746. '*************************************************************************
  2747.  
  2748. PUBLIC FUNCTION Lot_GetInfChapterSize (szChapter$)  AS LONG
  2749. '** Purpose:
  2750. '** Author:
  2751. '** Arguments:
  2752. '** Returns:
  2753. '**     
  2754. '*************************************************************************
  2755.    DIM size&
  2756.  
  2757.    size&= LcbGetInfChapterSize(szChapter$)
  2758.    if size& = -1 then
  2759.      Lot_GetInfChapterSize = -1         
  2760.    else
  2761.      Lot_GetInfChapterSize = size&
  2762.    end if
  2763.  
  2764. END FUNCTION
  2765. '*************************************************************************
  2766.  
  2767. PUBLIC SUB Lot_ToggleChapterFilesInCopyList (szChapter$)  
  2768. '** Purpose:
  2769. '** Author:
  2770. '** Arguments:
  2771. '** Returns:
  2772. '**     
  2773. '*************************************************************************
  2774.  
  2775.    If FToggleChapterFilesInCopylist(szChapter$) = 0 Then
  2776.       ERROR STFTOGGLE
  2777.    End If
  2778.  
  2779. END SUB
  2780.  
  2781.  
  2782. '*************************************************************************
  2783.  
  2784. PUBLIC FUNCTION Lot_SetChapterFilesInCopyListInOrOut (szChapter$, InOrOut%) AS INTEGER
  2785. '** Purpose: Given a chapter, This function turns the feature on or off.
  2786. '**          It is written to be especially careful that features are not
  2787. '**          turned on if they are not allowed to be. Examples are:
  2788. '**          NODE: If the feaure doesn't exist on the Server
  2789. '**          ANY TYPE: If the feature is not in the INF file
  2790. '** Author: Marcel Meth
  2791. '** Arguments: szChapter$: The chapter number, e.g. "1.2.1"
  2792. '**               InOrOut: 1 for in, 0 for Out
  2793. '** Returns: Wheter the feature is actually In (1) or Out (0)
  2794. '**          regardless of what the request was.
  2795. '**     
  2796. '*************************************************************************
  2797. DIM curinorout%, FeatureToFind$
  2798.  
  2799.    If szChapter$ = "" Then
  2800.       Lot_SetChapterFilesInCopyListInOrOut  = 0
  2801.       Exit FUNCTION
  2802.    End If
  2803.  
  2804.    curinorout% = Lot_GetChapterValInt(szChapter$, F_INOROUT)
  2805.    '** If the current setting already equals the requested setting
  2806.    If InOrOut% = curinorout% Then
  2807.       Lot_SetChapterFilesInCopyListInOrOut  = InOrOut%
  2808.       Exit FUNCTION
  2809.    End If
  2810.  
  2811.    '** If the requested setting is IN
  2812.    If  InOrOut% = 1 THEN
  2813.       Lot_SetChapterFilesInCopyListInOrOut = 1
  2814.  
  2815.       '** For a node install, make sure the server has the feature
  2816.       If GetSymbolValue("NETWORK") = gNODE Then
  2817.      FeatureToFind$ = Lot_GetChapterValStr(szChapter$, F_KEYWORD)
  2818.      If Lot_IsTheFeatureInstalled(FeatureToFind$) = FALSE Then
  2819.         Lot_SetChapterFilesInCopyListInOrOut = 0
  2820.         Exit Function
  2821.      End If
  2822.       End If
  2823.  
  2824.       If FToggleChapterFilesInCopylist(szChapter$) = 0 Then
  2825.      Lot_SetChapterFilesInCopyListInOrOut = 0
  2826.       End If
  2827.  
  2828.    '** If the requested setting is OUT
  2829.    Else
  2830.       Lot_SetChapterFilesInCopyListInOrOut = 0
  2831.       If FToggleChapterFilesInCopylist(szChapter$) = 0 Then
  2832.      Lot_SetChapterFilesInCopyListInOrOut = 1
  2833.       End If
  2834.    End If
  2835.  
  2836. END FUNCTION
  2837.  
  2838.  
  2839. '*************************************************************************
  2840.  
  2841. PUBLIC SUB Lot_InitializeCopyList (szChpt$, nField%) 
  2842. '** Purpose:
  2843. '** Author:
  2844. '** Arguments:
  2845. '** Returns:
  2846. '**     
  2847. '*************************************************************************
  2848.    if FInitializeCopyList(szChpt$, GetSymbolValue(SYM_STF_SRCDIR$), CLng(nField%)) = 0 then
  2849.       ErrorMsg 0, "Error initializing the copylist: " + szChpt$
  2850.       ERROR STFQUIT
  2851.    end if
  2852. END SUB
  2853. '*************************************************************************
  2854.  
  2855. PUBLIC SUB Lot_InitializeWinWinsysSym () 
  2856. '** Purpose: Sets win and winsys symbols
  2857. '** Author:  MZ
  2858. '*************************************************************************
  2859. DIM systemDir$
  2860.  
  2861.    'Set Windows directory symbol
  2862.    systemDir$ = GetWindowsDir()
  2863.    SetSymbolValue SYM_WINDIR$, systemdir$
  2864.  
  2865.    'Get Windows System directory
  2866.    systemDir$ = GetWindowsSysDir()
  2867.  
  2868.    'Check if I can write to the window system dir. and set winsysdir symbol
  2869.    IF(IsDirWritable(systemDir$)) = 1 THEN
  2870.       SetSymbolValue SYM_WINSYSDIR$, systemDir$
  2871.    ELSE
  2872.       SetSymbolValue SYM_WINSYSDIR$, GetWindowsDir()
  2873.    END IF
  2874. END SUB
  2875.  
  2876. ''* INitialize the gEXTRA LIST to 200000 bytes for the windows drive.
  2877. PUBLIC SUB Lot_InitializeEXTRA
  2878.     DIM drv$, drvno%, i%
  2879.    '' Add extra "FUDGE" space on Windows drive to allow for activities
  2880.    '' in windows directory.
  2881.    If GetListLength(gEXTRA) = 0 Then
  2882.       drv$ = Lot_ExtractDriveLetter(GetWindowsDir())
  2883.       drvno% = ASC(drv$) - ASC("a") + 1
  2884.       FOR i% = 1 to 26
  2885.      If i% = drvno% Then
  2886.         AddlistItem gEXTRA, "200000"
  2887.      Else
  2888.         AddlistItem gEXTRA, ""
  2889.      End If
  2890.       NEXT
  2891.    End If
  2892. END SUB
  2893.  
  2894. PUBLIC SUB Lot_RefreshDestination (symbol$) 
  2895. '** Purpose:
  2896. '** Author:
  2897. '** Arguments:
  2898. '** Returns:
  2899. '**     
  2900. '*************************************************************************
  2901.    if FRefreshDestination(symbol$) = FALSE THEN
  2902.       ErrorMsg 0, "Lot_RefreshDestination error: " + symbol$
  2903.       ERROR STFQUIT
  2904.    end if
  2905. END SUB
  2906.  
  2907. '*************************************************************************
  2908. PUBLIC SUB Lot_WriteDestinationSymAndVal (IniFileName$,IniSection$) 
  2909. '** Purpose:
  2910. '** Author:
  2911. '** Arguments:
  2912. '** Returns:
  2913. '**     
  2914. '*************************************************************************
  2915.    if FWriteDestinationSymAndVal(IniFileName$,IniSection$) = FALSE THEN
  2916.       ErrorMsg 0, "Lot_WriteDestinationSymAndVal error."
  2917.       ERROR STFQUIT
  2918.    end if
  2919. END SUB
  2920. '*************************************************************************
  2921.  
  2922. PUBLIC SUB Lot_GetDriveFreeSpaceList (szSymbol$)
  2923. '** Purpose: Creates a list of available drives, with space available
  2924. '** Author:
  2925. '** Arguments: sySymbol$        Name of list
  2926. '**     
  2927. '*************************************************************************
  2928. DIM     i%, nd%, rc$
  2929.    if FGetDriveFreeSpaceList(szSymbol$) = FALSE THEN
  2930.       ErrorMsg SID_ERR_LOT_GDFSL, ""
  2931.       ERROR STFQUIT
  2932.    end if
  2933. END SUB
  2934.  
  2935. PUBLIC FUNCTION Lot_AddToDriveFreeSpaceList (szSymbol$, szNewItem$) AS LONG
  2936. '** Purpose:Add a drive to a drive free space combo control 
  2937. '** Author:GJL
  2938. '** Arguments:szSymbol$ symbol for combo control
  2939. '**             szNewItem$ drive or UNC volume to add
  2940. '** Returns:TRUE if successful 
  2941. '**     
  2942. '*************************************************************************
  2943. DIM ret&
  2944.    ret& = FAddToDriveFreeSpaceList(szSymbol$, szNewItem$)
  2945.    IF ret& = 0 THEN
  2946.     Lot_AddToDriveFreeSpaceList = FALSE
  2947.    ELSE
  2948.     Lot_AddToDriveFreeSpaceList  = TRUE
  2949.    END IF
  2950. END FUNCTION
  2951. '*************************************************************************
  2952.  
  2953.  
  2954. '**UNC stuff
  2955. PUBLIC FUNCTION Lot_IsUnvalidatedUNCPath(szPath$) AS LONG
  2956. '** Purpose:Checks for 2 leading backslashes on a path
  2957. '** Author:GJL
  2958. '** Arguments:szPath$ a path
  2959. '** Returns:
  2960. '**     
  2961. '*************************************************************************
  2962.    IF FIsUnvalidatedUNCPath(szPath$) = 1 THEN
  2963.     Lot_IsUnvalidatedUNCPath = TRUE
  2964.    ELSE   
  2965.     Lot_IsUnvalidatedUNCPath = FALSE
  2966. END IF
  2967. END FUNCTION
  2968.  
  2969. PUBLIC FUNCTION Lot_IsValidUNCPath(szPath$) AS LONG
  2970. '** Purpose:determine whether a UNC volume is valid
  2971. '** Author:GJL
  2972. '** Arguments:A UNC volume with no trailing backslash
  2973. '** Returns:
  2974. '**     
  2975. '*************************************************************************
  2976.    IF FIsValidUNCPath(szPath$) = 1 THEN
  2977.     Lot_IsValidUNCPath = TRUE
  2978.    ELSE
  2979.     Lot_IsValidUNCPath = FALSE
  2980.    END IF
  2981. END FUNCTION
  2982.  
  2983. '**end UNC stuff
  2984.  
  2985.  
  2986. PUBLIC FUNCTION PopupModelessDlg (Dlg%, HelpID&) AS STRING
  2987. '** Purpose:
  2988. '** Author:
  2989. '** Arguments:
  2990. '** Returns:
  2991. '*************************************************************************
  2992.    DIM cuidll$, szWnd$, notused$, notused1%
  2993.  
  2994.  '-   cuidll$ = GetSymbolValue(SYM_CUIDLL$)
  2995.  ' JMD
  2996.  ' SYM_CUIDLL is now a list of DLLs
  2997.  ' First one contains code (dialog procs) and common resources
  2998.  ' Others contain product specific resources
  2999.  'NOTE: common DLL MUST be listed FIRST in the INI file
  3000.  '------------------------------
  3001.     cuidll$ = GetSymbolValue(SYM_CUIDLL$)
  3002.  
  3003.    'UIStartDlg(cuidll$, Dlg&, "FNameOrgDlgProc", APPHELP, "FHelpDlgProc")
  3004.    notused$ = UIStartDlg(cuidll$, Dlg%, FNAMEORGDLGPROC$, 0, "")
  3005.  
  3006.    ''Make sure the dialog gets fully painted
  3007.    szWnd$ = GetSymbolValue(SYM_WNDHANDLE$)
  3008.    notused1% = SendMessage(VAL(szWnd$),UM_PAINTMODELESS,0,0)
  3009. END FUNCTION
  3010.  
  3011. PUBLIC FUNCTION PopupWithFunction (Dlg%, HelpID&, Func$) AS STRING
  3012. '** Purpose:   Surface modal dialog box
  3013. '** Author:
  3014. '** Arguments:  Dlg%      ID of dialog template
  3015. '**             HelpID&   ID of help topic
  3016. '**             Func$     Dialog procedure name
  3017. '** Returns:     Exit string
  3018. '*************************************************************************
  3019.     DIM cuidll$, sz$, cdir$, notused%
  3020.  
  3021.  ' JMD
  3022.  ' SYM_CUIDLL is now a list of DLLs
  3023.  ' First one contains code (dialog procs) and common resources
  3024.  ' Others contain product specific resources
  3025.  'NOTE: common DLL MUST be listed FIRST in the INI file
  3026.  '------------------------------
  3027.  
  3028.     If GetSymbolValue(SYM_AUTOMATIONINST$) = gTRUE$ Then EXIT FUNCTION
  3029.     
  3030.     cuidll$ = GetSymbolValue(SYM_CUIDLL$)
  3031.     DO
  3032.         sz$ = UIStartDlg(cuidll$, Dlg%, Func$, 0, "")
  3033.  
  3034.         SELECT CASE sz$
  3035.         case "IDC_EXIT"
  3036.             notused% = FRemoveSymbol("IDC_TEXT")
  3037.             QUIT
  3038.             SetListItem "__DLG_ID", 1, STR(Dlg%)
  3039.         case "IDC_CANCEL" 
  3040.             EXIT DO
  3041.         case "IDC_CONTINUE" 
  3042.             EXIT DO
  3043.         case "IDC_OK" 
  3044.             EXIT DO
  3045.         case "IDC_MENU"
  3046.             EXIT DO
  3047.         case "IDC_BACK"
  3048.             EXIT DO
  3049.         case "IDC_CITHELP"
  3050.             cdir$ = GetSymbolValue(SYM_STF_CWDDIR$) + gINSTALLHLP$
  3051.             notused% = WinHelp(HwndFrame(), cdir$+">Overview", HELP_CONTEXT, HelpID&)
  3052.             SetListItem "RETFROMHELP", 1, "T"
  3053.         case "HELPKEY" 
  3054.             cdir$ = GetSymbolValue(SYM_STF_CWDDIR$) + gINSTALLHLP$
  3055.             notused% = WinHelp(HwndFrame(), cdir$+">Overview", HELP_CONTEXT, HelpID&)
  3056.             SetListItem "RETFROMHELP", 1, "T"
  3057.         END SELECT
  3058.     LOOP
  3059.     PopupWithFunction = MID$(sz$,5,LEN(sz$)-4)
  3060.     UIPop 1
  3061.     notused% = WinHelp(HwndFrame(), cdir$+">Overview", HELP_QUIT, HelpID&)
  3062. END FUNCTION
  3063.  
  3064. PUBLIC FUNCTION PopupModalDlg (Dlg%, HelpID&) AS STRING
  3065. '** Purpose:
  3066. '** Author:
  3067. '** Arguments:
  3068. '** Returns:
  3069. '*************************************************************************
  3070.     PopupModalDlg=PopupWithFunction(Dlg%, HelpID&, FNAMEORGDLGPROC$)
  3071. END FUNCTION
  3072.  
  3073. PUBLIC FUNCTION RegisterCallback (ModName$, FuncName$) AS INTEGER
  3074. '** Purpose:
  3075. '** Author:
  3076. '** Arguments:
  3077. '** Returns:
  3078. '*************************************************************************
  3079.   DIM rc%, automation$
  3080.  
  3081.   automation$ = GetSymbolValue(SYM_AUTOMATIONINST$)
  3082.   If  automation$ <> gTRUE$ Then
  3083.     RemoveSymbol(SYM_CALLBACK$)
  3084.     AddListItem SYM_CALLBACK$, FuncName$
  3085.     rc% = RegisterFunction(LSI_INFO(4),ModName$,FuncName$)
  3086.     If rc% = -4 Then
  3087.       ErrorMsg 0, "Maximum Number of Callbacks exceeded"
  3088.     End If
  3089.   End If
  3090. END FUNCTION
  3091.  
  3092. '*************************************************************************
  3093. '** FUNCTION SelectDriveCombo (ComboID$, path$)
  3094. '** Purpose:    Sets the ComboID dropdown to drive$
  3095. '**
  3096. '** IN SYMBOLS   Expects SYM_UPDATELIST$ to have an "ALL" entry
  3097. '**                 otherwise dropdown combo code asserts
  3098. '** OUT SYMBOLS  Adds 2 entries to the UPDATELIST 
  3099. '**     
  3100. '** Author:  Marcel Meth
  3101. '** Arguments:    ComboId$ - Id of the combo being set e.g. "IDC_COMBO1"
  3102. '**               path$ - Path that includes a drive letter or UNC vol.
  3103. '**     
  3104. '** If drive is not in combo box it will be added 
  3105. '**
  3106. '** Returns:  Index of the drive letter in the combo
  3107. '**     
  3108. '*************************************************************************
  3109. PUBLIC FUNCTION SelectDriveCombo (ComboID$, path$) AS INTEGER
  3110.    DIM n%, i%, drv$, dirpath$, position&, addRet&
  3111.    DIM FirstDriveLetter$
  3112.  
  3113.    n% = GetListLength(ComboID$)
  3114.    SelectDriveCombo = 1
  3115.    drv$ = Lot_ExtractDriveLetter(path$)
  3116. '** 
  3117. '** UNC path
  3118. '** 
  3119.    IF drv$ = "\" THEN
  3120.      Lot_SplitUNCPath path$, drv$, dirpath$
  3121.      IF Lot_IsvalidUNCPath(drv$) = FALSE THEN
  3122.        SelectDriveCombo = FALSE
  3123.        Exit FUNCTION
  3124.      END IF
  3125.      For i% = 1 to n%
  3126.        position& = InStr(LCASE$(GetListItem(ComboID$, i%)), LCASE$(drv$)) 
  3127.        If 0 < position Then
  3128.      AddListItem SYM_UPDATELIST$, ComboID$ 
  3129.      AddListItem SYM_UPDATELIST$, ComboID$ & "," & i%
  3130.      SelectDriveCombo = i%
  3131.      EXIT FUNCTION
  3132.        End If
  3133.      NEXT
  3134.      addRet& = Lot_AddToDriveFreeSpaceList(ComboID$, drv$)
  3135.      IF addRet&  = TRUE THEN
  3136.        i% = GetListLength(ComboID$)
  3137.        AddListItem SYM_UPDATELIST$, ComboID$ 
  3138.        AddListItem SYM_UPDATELIST$, ComboID$ & "," & i%
  3139.        SelectDriveCombo = i%
  3140.      ELSE 
  3141.        SelectDriveCombo = FALSE
  3142.      END IF
  3143. '** 
  3144. '** Drive letter given
  3145. '** 
  3146.    ELSE
  3147.      For i% = 1 to n%
  3148.        If drv$ = LCASE$(MID(GetListItem(ComboID$, i%), 1, 1)) Then
  3149.      AddListItem SYM_UPDATELIST$, ComboID$ 
  3150.      AddListItem SYM_UPDATELIST$, ComboID$ & "," & i%
  3151.      SelectDriveCombo = i% 
  3152.      EXIT FUNCTION
  3153.        End If
  3154.      Next
  3155. '** 
  3156. '** Drive not found in list
  3157. '** 
  3158.      IF Lot_AddToDriveFreeSpaceList(ComboID$, drv$)  = FALSE THEN
  3159.        SelectDriveCombo = FALSE
  3160.      ELSE
  3161.        i% = GetListLength(ComboID$)
  3162.        AddListItem SYM_UPDATELIST$, ComboID$ 
  3163.        AddListItem SYM_UPDATELIST$, ComboID$ & "," & i%
  3164.        SelectDriveCombo = i%
  3165.      END IF
  3166.    END IF
  3167.  
  3168. END FUNCTION
  3169.  
  3170. PUBLIC FUNCTION CheckForSpace(DlgId%) AS INTEGER
  3171. '** Purpose: Checks to see if there is enough space on dest directories
  3172. '**          First does a cheap check, followed, if need be by a high
  3173. '**          granularity check.
  3174. '** Author: Marcel Meth
  3175. '** Arguments:
  3176. '**     
  3177. '**     
  3178. '** Returns: SUCCESS/FAILURE
  3179. '**     
  3180. '*************************************************************************
  3181.     DIM lTicks&, lcb&, lNew&, i%, j%, lcbNeed&, dr$, s$, helpId&, rc$
  3182.     DIM notused1$, curcursor&, UNCSym$
  3183.  
  3184.    '** Try a quick check
  3185.    CheckForSpace = SUCCESS
  3186.    lTicks&       = GetTickCount()
  3187.    lcb&          = LcbGetChapterCost("", "", SYM_COST$, SYM_NEEDED$)
  3188.    IF lcb& = CLNG(0) THEN
  3189.       DO '** Keep the modeless up at least 2 seconds
  3190.      lNew& = GetTickCount()
  3191.       LOOP UNTIL (lNew& - lTicks&) > 2000
  3192.       DisplayWhenSpaceIsTight SYM_COST$, SYM_NEEDED$
  3193.       GOTO ENDCHECK
  3194.    END IF
  3195.    '** Try A High Granularity Check
  3196.    curcursor& = ShowWaitCursor()
  3197.    SetListItem "IDC_BMP", 1, STR$(IDD_MAXSCAN_BMP) '** put up the bitmap
  3198.    notused1$ = PopupModelessDlg(DB_CHECKSPACE, DB_CHECKSPACE)
  3199.    lcb& = GetCopyListCost (gEXTRA, SYM_COST$, SYM_NEEDED$)
  3200.    UIPOP 1     '** Bring down DB_CHECKSPACE
  3201.    RestoreCursor curcursor&
  3202.    IF lcb& = CLNG(0) THEN
  3203.       DisplayWhenSpaceIsTight SYM_COST$, SYM_NEEDED$
  3204.       GOTO ENDCHECK
  3205.    END IF
  3206.  
  3207.    '** If you get here then there was not enough space (Tab is CHR$(9))
  3208.    CheckForSpace = FAILURE
  3209.    RemoveSymbol "IDC_LIST1"
  3210.    FOR i% = 1 TO 26
  3211.       lcbNeed& = CLNG(GetListItem(SYM_NEEDED$, i%))
  3212.       IF  lcbNeed& > 0 THEN
  3213.      dr$ = CHR$(ASC("A")+i%-1) + ":" + CHR$(9)
  3214.      s$  = dr$ & (lcbNeed& + 4)
  3215.      AddlistItem "IDC_LIST1", s$ + gStrK$
  3216.       END IF
  3217.    NEXT
  3218.    j%=GetListLength("UNCVOLLIST")
  3219.    FOR i% = 1 to j%
  3220.       UNCSym$ = GetListItem("UNCVOLLIST",i%)
  3221.       lcbNeed& = CLNG(GetListItem(UNCSym$, 3))
  3222.       IF lcbNeed&  > 0 THEN
  3223. ''** HISHI - Aug/23/95
  3224. ''     s$ = Left$(UNCSym$, 18) + CHR$(9) & (lcbNeed& + 4)
  3225.          IF IsDBCSFirstAtOffset(UNCSym$, 18) = 0 THEN
  3226.             s$ = LeftBP(UNCSym$, 18)
  3227.          ELSE
  3228.             s$ = LeftBP(UNCSym$, 17)
  3229.          END IF
  3230.          s$ = s$ & CHR$(9) & (lcbNeed& + 4)
  3231. ''** END HISHI
  3232.      AddlistItem "IDC_LIST1", s$ + gStrK$
  3233.       END IF
  3234.    NEXT
  3235.  
  3236.  
  3237.    SetListItem "SETTABS1",1,"50"
  3238.    SetListItem "NORMALFONT", 1, STR$(IDC_TEXT1)
  3239.    SetListItem "NORMALFONT", 2, STR$(IDC_TEXT2)
  3240.    SetListItem "NORMALFONT", 3, STR$(IDC_TEXT3)
  3241.  
  3242.    helpId& = DlgId%
  3243.    rc$ = PopupModalDlg (DlgId%, helpId&)
  3244.  
  3245. ENDCHECK:
  3246.    RemoveSymbol(SYM_COST$)
  3247.    RemoveSymbol(SYM_NEEDED$)
  3248.  
  3249. END FUNCTION
  3250.  
  3251. '*************************************************************************
  3252. '** SUB DisplayWhenSpaceIsTight(szCost$,szNeed$)
  3253. '**
  3254. '** Purpose:    Display a warning message when disk space is tight
  3255. '**             You should only call this sub if you think there is
  3256. '**             enough disk space. This means that we will assume that
  3257. '**             szNeed$ contains only negative numbers.
  3258. '**
  3259. '**             The message will be displayed if 110% of cost will not
  3260. '**             fit on any one disk.
  3261. '**
  3262. '** Arguments:  szCost$ and szNeed$ - Symbols for cost and need
  3263. '**             Both symbol lists are expected to contain 26 numbers
  3264. '**     
  3265. '** Author:     DND
  3266. '**     
  3267. '*************************************************************************
  3268.  
  3269. PUBLIC SUB DisplayWhenSpaceIsTight(szCost$,szNeed$)
  3270.    DIM i%, lcbCost&, lcbNeed&, sz$, retcode%
  3271.    FOR i% = 1 TO 26
  3272.       lcbCost& =  (CLNG(GetListItem(szCost$, i%)) \ 1024) \ 10
  3273.       lcbNeed& = -CLNG(GetListItem(szNeed$, i%))
  3274.       IF lcbCost& > lcbNeed& THEN
  3275.      sz$ = LdString(SID_WARN_DISKSPACE1) + _
  3276.            LdString(SID_WARN_DISKSPACE2) + _
  3277.            LdString(SID_WARN_DISKSPACE3)
  3278.      'MessageBox sz$, MB_OK+MB_ICONINFORMATION, LdString(SID_TKT_STD_TITLE)
  3279.      retcode% = DoMsgBox(sz$,LdString(SID_TKT_STD_TITLE),MB_OKCANCEL _
  3280.                    +MB_ICONINFORMATION)
  3281.             if retcode% = IDCANCEL then
  3282.                 QUIT
  3283.             end if
  3284.      EXIT FOR
  3285.       END IF
  3286.    NEXT
  3287.  
  3288. END SUB
  3289.  
  3290. '******** Microsoft Functions that Lotus re-wrote **************************
  3291.  
  3292.  
  3293.  
  3294. PUBLIC SUB ReadInfFile (szFile$) 
  3295. '** Purpose:
  3296. '** Author:
  3297. '** Arguments: szFile$
  3298. '*************************************************************************
  3299. %rem
  3300. '    if FValidFATPath(szFile$) = 0 then
  3301. '        BadArgErr 1, "ReadInfFile", szFile$
  3302. '    end if
  3303. '    IF FOpenInf(szFile$, 1, 1) = 0 THEN
  3304. '        StfApiErr saeFail, "ReadInfFile", szFile$
  3305. %endrem
  3306.     IF FOpenInf(szFile$, 1, 0) = 0 THEN
  3307.     ErrorMsg SID_ERR_READINFFILE, ""
  3308.     ERROR STFQUIT
  3309.     END IF
  3310. END SUB
  3311.  
  3312. PUBLIC SUB MakeListFromSectionKeys(szSymbol$, szSect$) 
  3313. '** Purpose:
  3314. '** Author:
  3315. '** Arguments: szSymbol$, szSect$
  3316. '*************************************************************************
  3317. %rem
  3318.     if szSymbol$ = "" then
  3319.     n% = 1
  3320.     elseif FValidInfSect(szSect$) = 0 then
  3321.     n% = 2
  3322.     else
  3323.     n% = 0
  3324.     end if
  3325.     if n% > 0 then
  3326.     BadArgErr n%, "MakeListFromSectionKeys", szSymbol$+", "+szSect$
  3327.     end if
  3328. %endrem ''DEBUG
  3329.  
  3330.     IF FSetSymbolToListOfInfKeys(szSymbol$, szSect$, 1) = 0 THEN
  3331.     ErrorMsg SID_ERR_MAKELISTFROMSECTIONKEYS, ""
  3332.     ERROR STFQUIT
  3333.     END IF
  3334. END SUB
  3335.  
  3336. PUBLIC SUB MakeListFromSectionDate (szSym$, szSect$) 
  3337. '** Purpose:
  3338. '** Author:
  3339. '** Arguments: szSym$, szSect$
  3340. '** Returns:
  3341. '**     
  3342. '*************************************************************************
  3343. %rem
  3344.     if szSym$ = "" then
  3345.     n% = 1
  3346.     elseif FValidInfSect(szSect$) = 0 then
  3347.     n% = 2
  3348.     else
  3349.     n% = 0
  3350.     end if
  3351.     if n% > 0 then
  3352.     BadArgErr n%, "MakeListFromSectionDate", szSym$+", "+szSect$
  3353.     end if
  3354. %endrem ''DEBUG
  3355.  
  3356.     IF FMakeListInfSectionField(szSym$, szSect$, 5) = 0 THEN
  3357.     ErrorMsg SID_ERR_MAKELISTFROMSECTIONDATE, ""
  3358.     ERROR STFQUIT
  3359.     END IF
  3360. END SUB
  3361.  
  3362. PUBLIC SUB MakeListFromSectionFilename (szSym$, szSect$) 
  3363. '** Purpose:
  3364. '** Author:
  3365. '** Arguments: szSym$, szSect$
  3366. '** Returns:
  3367. '**     
  3368. '*************************************************************************
  3369. %rem
  3370.     if szSym$ = "" then
  3371.     n% = 1
  3372.     elseif FValidInfSect(szSect$) = 0 then
  3373.     n% = 2
  3374.     else
  3375.     n% = 0
  3376.     end if
  3377.     if n% > 0 then
  3378.     BadArgErr n%, "MakeListFromSectionFilename", szSym$+", "+szSect$
  3379.     end if
  3380. %endrem ''DEBUG
  3381.  
  3382.     IF FMakeListInfSectionField(szSym$, szSect$, 1) = 0 THEN
  3383.     ErrorMsg SID_ERR_MAKELISTFROMSECTIONFILENAME, ""
  3384.     ERROR STFQUIT
  3385.     END IF
  3386. END SUB
  3387.  
  3388. PUBLIC SUB MakeListFromSectionSize (szSym$, szSect$) 
  3389. '** Purpose:
  3390. '** Author:
  3391. '** Arguments: szSym$, szSect$
  3392. '** Returns:
  3393. '**     
  3394. '*************************************************************************
  3395. %rem
  3396.     if szSym$ = "" then
  3397.     n% = 1
  3398.     elseif FValidInfSect(szSect$) = 0 then
  3399.     n% = 2
  3400.     else
  3401.     n% = 0
  3402.     end if
  3403.     if n% > 0 then
  3404.     BadArgErr n%, "MakeListFromSectionSize", szSym$+", "+szSect$
  3405.     end if
  3406. %endrem ''DEBUG
  3407.  
  3408.     IF FMakeListInfSectionField(szSym$, szSect$, 15) = 0 THEN
  3409.     ErrorMsg SID_ERR_MAKELISTFROMSECTIONSIZE, ""
  3410.     ERROR STFQUIT
  3411.     END IF
  3412. END SUB
  3413.  
  3414. PUBLIC SUB MakeListFromSectionVersion (szSym$, szSect$) 
  3415. '** Purpose:
  3416. '** Author:
  3417. '** Arguments: szSym$, szSect$
  3418. '** Returns:
  3419. '**     
  3420. '*************************************************************************
  3421. %rem
  3422.     if szSym$ = "" then
  3423.     n% = 1
  3424.     elseif FValidInfSect(szSect$) = 0 then
  3425.     n% = 2
  3426.     else
  3427.     n% = 0
  3428.     end if
  3429.     if n% > 0 then
  3430.     BadArgErr n%, "MakeListFromSectionVersion", szSym$+", "+szSect$
  3431.     end if
  3432. %endrem ''DEBUG
  3433.  
  3434.     IF FMakeListInfSectionField(szSym$, szSect$, 19) = 0 THEN
  3435.     ErrorMsg SID_ERR_MAKELISTFROMSECTIONVERSION, ""
  3436.     ERROR STFQUIT
  3437.     END IF
  3438. END SUB
  3439.  
  3440. PUBLIC FUNCTION SetSilentMode (mode%)  AS INTEGER
  3441. '** Purpose:
  3442. '** Author:
  3443. '** Arguments: mode%
  3444. '** Returns:
  3445. '**     
  3446. '*************************************************************************
  3447.     DIM temp&
  3448.  
  3449.     temp& = CLNG ( mode% )
  3450.     SetSilentMode = FSetSilent( temp& )
  3451. END FUNCTION
  3452.  
  3453. PUBLIC FUNCTION SetBeepingMode (mode%)  AS INTEGER
  3454. '** Purpose:
  3455. '** Author:
  3456. '** Arguments: mode%
  3457. '** Returns:
  3458. '**     
  3459. '*************************************************************************
  3460.     DIM temp&
  3461.  
  3462.     temp& = CLNG ( mode% )
  3463.  
  3464.     SetBeepingMode = FSetBeepingMode( temp& )
  3465. END FUNCTION
  3466.  
  3467. PUBLIC FUNCTION GetSectionKeyDate (szSect$, szKey$)  AS STRING
  3468. '** Purpose:
  3469. '** Author:
  3470. '** Arguments: szSect$, szKey$
  3471. '** Returns:
  3472. '**     
  3473. '*************************************************************************
  3474. %rem
  3475.     if FValidInfSect(szSect$) = 0 then
  3476.     n% = 1
  3477.     elseif szKey$ = "" then
  3478.     n% = 2
  3479.     else
  3480.     n% = 0
  3481.     end if
  3482.     if n% > 0 then
  3483.     BadArgErr n%, "GetSectionKeyDate", szSect$+", "+szKey$
  3484.     end if
  3485. %endrem ''DEBUG
  3486.     DIM szBuf$, Length&
  3487.  
  3488.     szBuf$ = string$(128, 32) 
  3489.     Length& = CbGetInfSectionKeyField(szSect$, szKey$, 5, szBuf$, 128)
  3490.     IF Length& >= 128 THEN
  3491.     ErrorMsg SID_ERR_GETSECTIONKEYDATE, ""
  3492.     ERROR STFQUIT
  3493.     END IF
  3494.  
  3495.     IF Length& = -1 THEN
  3496.     ErrorMsg SID_ERR_GETSECTIONKEYDATE2, ""
  3497.     ERROR STFQUIT
  3498.     END IF
  3499.  
  3500.     GetSectionKeyDate = LEFT$ (szBuf$, CInt(Length&))
  3501.     szBuf$ = ""
  3502. END FUNCTION
  3503.  
  3504. PUBLIC FUNCTION GetSectionKeyFilename (szSect$, szKey$)  AS STRING
  3505. '** Purpose:
  3506. '** Author:
  3507. '** Arguments: szSect$, szKey$
  3508. '** Returns:
  3509. '**     
  3510. '*************************************************************************
  3511. %rem
  3512.     if FValidInfSect(szSect$) = 0 then
  3513.     n% = 1
  3514.     elseif szKey$ = "" then
  3515.     n% = 2
  3516.     else
  3517.     n% = 0
  3518.     end if
  3519.     if n% > 0 then
  3520.     BadArgErr n%, "GetSectionKeyFilename", szSect$+", "+szKey$
  3521.     end if
  3522. %endrem ''DEBUG
  3523.     DIM szBuf$, Length&
  3524.  
  3525.     szBuf$ = string$(128, 32)
  3526.     Length& = CbGetInfSectionKeyField(szSect$, szKey$, 1, szBuf$, 128)
  3527.     IF Length& >= 128 THEN
  3528.     ErrorMsg SID_ERR_GETSECTIONKEYFILENAME, ""
  3529.     ERROR STFQUIT
  3530.     END IF
  3531.  
  3532.     IF Length& = -1 THEN
  3533.     ErrorMsg SID_ERR_GETSECTIONKEYFILENAME2, ""
  3534.     ERROR STFQUIT
  3535.     END IF
  3536.  
  3537.     GetSectionKeyFilename = LEFT$ (szBuf$, CInt(Length&) )
  3538.     szBuf$ = ""
  3539. END FUNCTION
  3540.  
  3541. PUBLIC FUNCTION GetSectionKeySize (szSect$, szKey$)  AS LONG
  3542. '** Purpose:
  3543. '** Author:
  3544. '** Arguments: szSect$, szKey$
  3545. '** Returns:
  3546. '**     
  3547. '*************************************************************************
  3548. %rem
  3549.     if FValidInfSect(szSect$) = 0 then
  3550.     n% = 1
  3551.     elseif szKey$ = "" then
  3552.     n% = 2
  3553.     else
  3554.     n% = 0
  3555.     end if
  3556.     if n% > 0 then
  3557.     BadArgErr n%, "GetSectionKeySize", szSect$+", "+szKey$
  3558.     end if
  3559. %endrem ''DEBUG
  3560.     DIM szBuf$, Length&
  3561.  
  3562.     szBuf$ = string$(128, 32)
  3563.     Length& = CbGetInfSectionKeyField(szSect$, szKey$, 15, szBuf$, 128)
  3564.     IF Length& >= 128 THEN
  3565.     ErrorMsg SID_ERR_GETSECTIONKEYSIZE, ""
  3566.     ERROR STFQUIT
  3567.     END IF
  3568.  
  3569.     IF Length& = -1 THEN
  3570.     ErrorMsg SID_ERR_GETSECTIONKEYSIZE2, ""
  3571.     ERROR STFQUIT
  3572.     END IF
  3573.     
  3574.     GetSectionKeySize = VAL (LEFT$ (szBuf$, CInt(Length&)) )
  3575.     szBuf$ = ""
  3576. END FUNCTION
  3577.  
  3578. PUBLIC FUNCTION GetSectionKeyVersion (szSect$, szKey$)  AS STRING
  3579. '** Purpose:
  3580. '** Author:
  3581. '** Arguments: szSect$, szKey$
  3582. '** Returns:
  3583. '**     
  3584. '*************************************************************************
  3585. %rem
  3586.     if FValidInfSect(szSect$) = 0 then
  3587.     n% = 1
  3588.     elseif szKey$ = "" then
  3589.     n% = 2
  3590.     else
  3591.     n% = 0
  3592.     end if
  3593.     if n% > 0 then
  3594.     BadArgErr n%, "GetSectionKeyVersion", szSect$+", "+szKey$
  3595.     end if
  3596. %endrem ''DEBUG
  3597.     DIM szBuf$, Length&
  3598.  
  3599.     szBuf$ = string$(128, 32) 
  3600.     Length& = CbGetInfSectionKeyField(szSect$, szKey$, 19, szBuf$, 128)
  3601.     IF Length& >= 128 THEN
  3602.     ErrorMsg SID_ERR_GETSECTIONKEYVERSION, ""
  3603.     ERROR STFQUIT
  3604.     END IF
  3605.  
  3606.     IF Length& = -1 THEN
  3607.     ErrorMsg SID_ERR_GETSECTIONKEYVERSION2, ""
  3608.     ERROR STFQUIT
  3609.     END IF
  3610.  
  3611.     GetSectionKeyVersion = LEFT$ (szBuf$, CInt(Length&))
  3612.     szBuf$ = ""
  3613. END FUNCTION
  3614.  
  3615. PUBLIC SUB RemoveDir (szDir$, cmo%) 
  3616. '** Purpose:
  3617. '** Author:
  3618. '** Arguments: szDir$, cmo%
  3619. '*************************************************************************
  3620. %rem
  3621.     if FValidFATDir(szDir$) = 0 then
  3622.     BadArgErr 1, "RemoveDir", szDir$+", "+STR$(cmo%)
  3623.     end if
  3624. %endrem ''DEBUG
  3625.     IF FRemoveDir(szDir$) = 0 THEN
  3626.     ErrorMsg SID_ERR_REMOVEDIR, ""
  3627.     ERROR STFERR
  3628.     END IF
  3629. END SUB
  3630.  
  3631. PUBLIC SUB DumpCopyList (szFile$) 
  3632. '** Purpose:
  3633. '** Author:
  3634. '** Arguments: szFile$
  3635. '*************************************************************************
  3636. %rem
  3637.     if szFile$ = "" then
  3638.     BadArgErr 1, "DumpCopyList", szFile$
  3639.     end if
  3640. %endrem ''DEBUG
  3641.     IF FDumpCopyListToFile (szFile$) = 0 THEN
  3642.     ErrorMsg SID_ERR_DUMPCOPYLIST, ""
  3643.     ERROR STFERR
  3644.     END IF
  3645. END SUB
  3646.  
  3647. PUBLIC SUB ClearCopyList 
  3648. '** Purpose:
  3649. '** Author:
  3650. '** Arguments: None
  3651. '*************************************************************************
  3652.     ResetCopyList
  3653. END SUB
  3654.  
  3655. PUBLIC FUNCTION GetCopyListCost (szExtraList$, szCostList$, szNeedList$)  AS LONG
  3656. '** Purpose:
  3657. '** Author:
  3658. '** Arguments: szExtraList$, szCostList$, szNeedList$
  3659. '** Returns:
  3660. '**     
  3661. '*************************************************************************
  3662.     DIM lNeed&
  3663.  
  3664.     lNeed& = LcbGetCopyListCost (szExtraList$, szCostList$, szNeedList$)
  3665.     IF lNeed& < 0 THEN
  3666.     ErrorMsg SID_ERR_GETCOPYLISTCOST, ""
  3667.     ERROR STFQUIT
  3668.     END IF
  3669.     GetCopyListCost = lNeed&
  3670. END FUNCTION
  3671.  
  3672. PUBLIC SUB CopyFilesInCopyList 
  3673. '** Purpose:
  3674. '** Author:
  3675. '** Arguments:
  3676. '** Returns:
  3677. '**     
  3678. '*************************************************************************
  3679.     DIM grc&
  3680.  
  3681.     grc& = GrcCopyFilesInCopyList (HinstFrame())
  3682.  
  3683.     IF grc& = grcUserQuit THEN
  3684.     ErrorMsg SID_ERR_NOT_COMPLETE, ""
  3685.     ERROR STFQUIT
  3686.     ELSEIF grc& > 0 THEN
  3687.     ErrorMsg SID_ERR_NOT_COMPLETE, ""
  3688.     ERROR STFQUIT
  3689.     END IF
  3690. END SUB
  3691.  
  3692. PUBLIC SUB AddSectionFilesToCopyList (szSect$, szSrc$, szDest$) 
  3693. '** Purpose:
  3694. '** Author:
  3695. '** Arguments:
  3696. '** Returns:
  3697. '**     
  3698. '*************************************************************************
  3699. %rem
  3700.     if FValidInfSect(szSect$) = 0 then
  3701.     n% = 1
  3702.     elseif FValidFATDir(szSrc$) = 0 then
  3703.     n% = 2
  3704.     elseif FValidFATDir(szDest$) = 0 then
  3705.     n% = 3
  3706.     else
  3707.     n% = 0
  3708.     end if
  3709.     if n% > 0 then
  3710.     BadArgErr n%, "AddSectionFilesToCopyList", szSect$+", "+szSrc$+", "+szDest$
  3711.     end if
  3712. %endrem ''DEBUG
  3713.  
  3714.     IF FAddSectionFilesToCopyList (szSect$, szSrc$, szDest$) = 0 THEN
  3715.     ErrorMsg SID_ERR_ADDSECTIONFILESTOCOPYLIST, ""
  3716.     ERROR STFQUIT
  3717.     END IF
  3718. END SUB
  3719. '*************************************************************************
  3720.  
  3721. PUBLIC SUB AddSectionKeyFileToCopyList (szSect$, szKey$, szSrc$, szDest$) 
  3722. '** Purpose:
  3723. '** Author:
  3724. '** Arguments:
  3725. '** Returns:
  3726. '**     
  3727. '*************************************************************************
  3728. %rem
  3729.     if FValidInfSect(szSect$) = 0 then
  3730.     n% = 1
  3731.     elseif szKey$ = "" then
  3732.     n% = 2
  3733.     elseif FValidFATDir(szSrc$) = 0 then
  3734.     n% = 3
  3735.     elseif FValidFATDir(szDest$) = 0 then
  3736.     n% = 4
  3737.     else
  3738.     n% = 0
  3739.     end if
  3740.     if n% > 0 then
  3741.     BadArgErr n%, "AddSectionKeyFileToCopyList", szSect$+", "+szKey$+", "+szSrc$+", "+szDest$
  3742.     end if
  3743. %endrem ''DEBUG
  3744.  
  3745.     IF FAddSectionKeyFileToCopyList (szSect$, szKey$, szSrc$, szDest$) = 0 THEN
  3746.     ErrorMsg SID_ERR_ADDSECTIONKEYFILETOCOPYLIST, ""
  3747.     ERROR STFQUIT
  3748.     END IF
  3749. END SUB
  3750.  
  3751. PUBLIC SUB AddToBillboardList (szDll$, idDlg&, szProc$, lTicks&) 
  3752. '** Purpose:
  3753. '** Author:
  3754. '** Arguments:
  3755. '** Returns:
  3756. '**     
  3757. '** NOTE: Argument szProc$ not used -- retained for backward compatibility
  3758. '*************************************************************************
  3759. DIM rc&,i%, Dll$
  3760. %rem
  3761.     if szDll$ = "" then
  3762.     n% = 1
  3763.     elseif idDlg& = 0 then
  3764.     n% = 2
  3765.     elseif szProc$ = "" then
  3766.     n% = 3
  3767.     elseif lTicks& <= 0 then
  3768.     n% = 4
  3769.     else
  3770.     n% = 0
  3771.     end if
  3772.     if n% > 0 then
  3773.     BadArgErr n%, "AddToBillboardList", szDll$+", "+STR$(idDlg&)+", "+szProc$+", "+STR$(lTicks&)
  3774.     end if
  3775. %endrem ''DEBUG
  3776.     Dll$ = FindResourceinDLL (idDlg&, RT_DIALOG)
  3777.     if Dll$ <> "" then
  3778.         IF FAddToBillboardList(Dll$, idDlg&, FNAMEORGDLGPROC$, lTicks&) <> 0 THEN
  3779.               Exit Sub
  3780.         END IF
  3781.     End if
  3782. label1:
  3783.    ErrorMsg SID_ERR_ADDTOBILLBOARDLIST, ""
  3784.    ERROR STFQUIT
  3785.  
  3786. END SUB
  3787.  
  3788. PUBLIC FUNCTION FindResourceinDLL (idDlg&, ResType%) AS STRING
  3789. '** Purpose: Traverses the list of DLLs in SYM_CUIDLL$ until it finds the
  3790. '**                             one that contains the resource
  3791. '** Author:     JMDonohue
  3792. '** Arguments:  id%     Resource id number
  3793. '** Returns:    String containing the DLL name or null string if not found
  3794. '*************************************************************************
  3795.     DIM rc&,i%, Dll$, szDlls$
  3796.     i% = 1
  3797.     szDlls$ = GetSymbolValue(SYM_CUIDLL$)
  3798.     WHILE (TRUE)
  3799.         Dll$ =  Lot_GetNthFieldFromIniString (szDlls$, i%, "") 
  3800.         if Dll$ <> "" then
  3801.            rc& = GetModuleHandle(Dll$) 
  3802.             If rc& <> 0 Then
  3803.                 rc& = FindResource(rc&, idDlg&, ResType%) 
  3804.             End If
  3805.             If rc& <> 0 Then
  3806.                 FindResourceinDLL = Dll$
  3807.                 Exit Function
  3808.             End If
  3809.         else
  3810.             FindResourceinDLL = ""
  3811.             Exit Function
  3812.         end if
  3813.         i% = i% + 1
  3814.    WEND
  3815. END FUNCTION
  3816.  
  3817. PUBLIC SUB AddBlankToBillboardList (lTicks&) 
  3818. '** Purpose:
  3819. '** Author:
  3820. '** Arguments:
  3821. '** Returns:
  3822. '**     
  3823. '*************************************************************************
  3824. %rem
  3825.     if lTicks& <= 0 then
  3826.     BadArgErr 1, "AddBlankToBillboardList", STR$(lTicks&)
  3827.     end if
  3828. %endrem ''DEBUG
  3829.     IF FAddToBillboardList("", 0, "", lTicks&) = 0 THEN
  3830.     'YYYYYYIF FAddToBillboardList(NULL, 0, NULL, lTicks&) = 0 THEN
  3831.     ErrorMsg SID_ERR_ADDBLANKTOBILLBOARDLIST, ""
  3832.     ERROR STFQUIT
  3833.     END IF
  3834. END SUB
  3835.  
  3836. PUBLIC SUB ClearBillboardList 
  3837. '** Purpose:
  3838. '** Author:
  3839. '** Arguments:
  3840. '** Returns:
  3841. '**     
  3842. '*************************************************************************
  3843.     IF FClearBillboardList() = 0 THEN
  3844.     ErrorMsg SID_ERR_CLEARBILLBOARDLIST, ""
  3845.     ERROR STFQUIT
  3846.     END IF
  3847. END SUB
  3848.  
  3849. PUBLIC SUB SetCopyGaugePosition (x%, y%) 
  3850. '** Purpose:
  3851. '** Author:
  3852. '** Arguments:
  3853. '** Returns:
  3854. '**     
  3855. '*************************************************************************
  3856.     DIM xt&, yt&
  3857.  
  3858.     xt& = CLNG ( x% )
  3859.     yt& = CLNG ( y% )
  3860.     ProSetPos xt&, yt&
  3861. END SUB
  3862.  
  3863. PUBLIC SUB QUIT
  3864. '** Purpose:
  3865. '** Author:
  3866. '** Arguments:
  3867. '*************************************************************************
  3868.    DIM sz$
  3869.  
  3870.    sz$ = PopupModalDlg (DB_EXITHISTORY, DB_EXITHISTORY)
  3871.    If sz$ = "OK" Then
  3872.       UIPopAll
  3873.         gEndStatementEncountered% = TRUE      
  3874.       END
  3875.    End If
  3876. END SUB
  3877.  
  3878.  
  3879. '*************************************************************************
  3880. '** FUNCTION Lot_WriteToRiFile(ripath$) AS INTEGER
  3881. '**            
  3882. '** Purpose:   Writes user, company and serial number in 123w.ri file. 
  3883. '** Author:    JYOTI KEDIA
  3884. '** Arguments: None
  3885. '** Returns:   SUCCESS or Failure
  3886. '*************************************************************************
  3887.  
  3888. PUBLIC FUNCTION Lot_WriteToRiFile (ripath$) AS INTEGER
  3889. DIM  uname$, cname$, snum$
  3890.  
  3891.    Lot_WriteToRiFile = TRUE
  3892.  
  3893. '** Removed all checks on length of names mmeth-8/7/95
  3894. '** C Code now truncates strings if they are too long
  3895.    uname$ = GetSymbolValue("NAME")
  3896. 'print uname$,"uname$"
  3897. 'print uname$,"uname$"
  3898.    cname$ = GetSymbolValue(SYM_COMPANY$)
  3899. 'print cname$,"cname$"
  3900. 'print cname$,"cname$"
  3901.    snum$  = GetSymbolValue(SYM_SERIALNUM$)
  3902.  
  3903.    IF WriteUserRegistration(ripath$,uname$,cname$,snum$) <> 0 Then
  3904.       Lot_WriteToRiFile = FALSE
  3905.    End If
  3906.  
  3907. END FUNCTION
  3908.  
  3909. '*************************************************************************
  3910. '** FUNCTION Lot_ReadDefaultsfromRi(default_ripath$) AS INTEGER
  3911. '**
  3912. '** Purpose: For standard,Server and node install reads the default user,
  3913. '**          company name and serial number from 123w.ri file. For
  3914. '**            
  3915. '** Author:    JYOTI KEDIA
  3916. '** Arguments: Sets: SYM_NAME$, SYM_COMPANY$, SYM_SERIALNUM$
  3917. '** Returns:   TURE (SUCCESS)  FALSE (FAILURE)
  3918. '*************************************************************************
  3919.  
  3920. PUBLIC FUNCTION Lot_ReadDefaultsfromRi (default_ripath$) AS INTEGER
  3921. DIM rc%, lrc&, n%
  3922.  
  3923.    DIM buf1 AS STRING : buf1 = CreateBuffer(82)   '* These strings can be upto  80
  3924.    DIM buf2 AS STRING : buf2 = CreateBuffer(82)   '* bytes not including terminator.
  3925.    DIM buf3 AS STRING : buf3 = CreateBuffer(18)   '* See lcomstf\userreg.cpp &
  3926.                           '* callback.lss:WELCOMECB
  3927.  
  3928.    Lot_ReadDefaultsfromRi = FALSE
  3929.  
  3930.    lrc& = DoesFileExist(default_ripath$,femExists)
  3931.    if lrc& = 0 goto rinotfound
  3932.  
  3933.  
  3934.    lrc& = ReadUserRegistration(default_ripath$,buf1,buf2,buf3)
  3935.    If lrc& <> 0 goto rinotfound
  3936.  
  3937.    n% = LEN(buf1)
  3938.    SetSymbolValue SYM_NAME$, LEFT$(buf1, n%)
  3939.    n% = LEN(buf2)
  3940.    SetSymbolValue SYM_COMPANY$, LEFT$(buf2, n%)
  3941.    n% = LEN(buf3)
  3942.    SetSymbolValue SYM_SERIALNUM$, LEFT$(buf3, n%)
  3943.  
  3944.    Lot_ReadDefaultsfromRi = TRUE
  3945.  
  3946.    EXIT FUNCTION
  3947.  
  3948. rinotfound: 
  3949.    
  3950. END FUNCTION
  3951.  
  3952.  
  3953. PUBLIC FUNCTION Lot_GetCurrentProduct() AS INTEGER
  3954. '** Purpose:    This function will return the current product number
  3955. '** Parameters: 
  3956. '** Return:     Product number
  3957. '*************************************************************************
  3958.    Lot_GetCurrentProduct = gCurrentProduct%
  3959. END FUNCTION
  3960.  
  3961. PUBLIC SUB Lot_SetCurrentProduct(ProdNo%) 
  3962. '** Purpose:    Set the current product number
  3963. '** Parameters: ProdNo%  the product number
  3964. '*************************************************************************
  3965.    IF ProdNo% > gMaxNumOfProds% THEN
  3966. '      ERROR STFSETERROR
  3967.       ERROR STFQUIT
  3968.    END IF
  3969.    gCurrentProduct% = ProdNo%
  3970. END SUB
  3971.  
  3972. PUBLIC FUNCTION Lot_GetInstallDir() AS STRING
  3973. '** Purpose:    Return the directory where Install will be installed.
  3974. '** Parameters: 
  3975. '** Return:     Install dir
  3976. '*************************************************************************
  3977.    DIM s$, network$
  3978.  
  3979.    s$ = GetSymbolValue(SYM_SINGLESMARTSUITE$)
  3980.    network$ = GetSymbolValue(SYM_NETWORK$)
  3981.    IF network$ <> gNODE THEN
  3982.       IF s$ = gSMARTSUITE$ THEN
  3983.      Lot_GetInstallDir = GetSymbolValue(SYM_BASEDIR$)
  3984.       ELSE
  3985.      s$ = Reg_GetDirSymbolList(1)     '** First product dir list
  3986.      s$ = GetListItem(s$,1)           '** First directory symbol
  3987.      Lot_GetInstallDir = GetSymbolValue(s$)
  3988.       END IF
  3989.    ELSE
  3990.      Lot_GetInstallDir = GetSymbolValue(SYM_STF_SRCDIR$)
  3991.    END IF
  3992.  
  3993. END FUNCTION
  3994.  
  3995.  
  3996. '** FUNCTION Lot_GetTheRealProdDir(prodno%) AS STRING
  3997. '**            
  3998. '** Purpose:   Retrieve the read 123 directory
  3999. '** Author:    JYOTI KEDIA
  4000. '** Arguments: None
  4001. '** Returns:   The 123 directory (with trailing backslash)
  4002. '*************************************************************************
  4003.  
  4004. PUBLIC FUNCTION Lot_GetTheRealProdDir(prodno%) AS STRING
  4005.    DIM sym$, prodsym$, progdir$, basedir$, l%, m%, disks$, dlen%
  4006.    
  4007.    If GetSymbolValue(SYM_NETWORK$) <> gNODE$ Then
  4008.       sym$ = Reg_GetDirSymbolList(prodno%)
  4009.       prodsym$ = GetListItem(sym$, 1)
  4010.       progdir$ = GetListItem(prodsym$,1)
  4011.    Else
  4012.       If GetSymbolValue (SYM_SINGLESMARTSUITE) =  gSINGLE$ Then
  4013.     disks$ = GetSymbolValue(SYM_INSTALL_SOURCE$)
  4014.     dlen% = LEN(disks$)
  4015.     If dlen% <=0 Then
  4016.        disks$ = GetSymbolValue(SYM_STF_SRCDIR$)
  4017.        dlen% = LEN(disks$)
  4018.      End If
  4019.     If MID$(disks$,dlen%,1) <> "\" Then
  4020.        disks$ = disks$ + "\"
  4021.     End If
  4022.     progdir$ = disks$
  4023.       Else
  4024.     '** USE THE product dir symbol, to extrapolate what
  4025.     '** the directory is on the server.
  4026.  
  4027. ''**** MMETH ???  STILL NEEDS WORK!
  4028. ''**** MMETH ???  I don't think SYMBASEDIR is always correct!
  4029.  
  4030.     sym$ = Reg_GetDirSymbolList(prodno%)
  4031.     prodsym$ = GetListItem(sym$, 1)
  4032.     progdir$ = GetListItem(prodsym$,1)
  4033.     basedir$ = GetSymbolValue (SYM_BASEDIR$)
  4034.     l% = INSTR(progdir$, basedir$)
  4035.     
  4036.     l% = INSTR(l%, progdir$, "\")
  4037.     m% = INSTR(l%, progdir$, "\")
  4038.  
  4039.     progdir$ = GetSymbolValue (SYM_INSTALL_SOURCE) +_
  4040.            RIGHT$( LEFT$ (progdir$, m%), l%)
  4041.            
  4042.       End If
  4043.    End If
  4044.  
  4045.    Lot_GetTheRealProdDir = progdir$
  4046.  
  4047. END FUNCTION
  4048.  
  4049.  
  4050. '*************************************************************************
  4051. '** FUNCTION Lot_ReadSerialNumber () AS INTEGER
  4052. '**
  4053. '** Purpose:   Reads serial number from SN.DAT and sets the symbol SERIALNUM.
  4054. '** Author:    JYOTI KEDIA
  4055. '** Arguments: None
  4056. '** Returns:   SUCCESS or FAILURE
  4057. '*************************************************************************
  4058.  
  4059. PUBLIC FUNCTION Lot_ReadSerialNumber () AS INTEGER
  4060.  
  4061.    DIM buf1 AS STRING : buf1 = CreateBuffer(18)
  4062.    DIM snpath$, rc&
  4063.  
  4064.    snpath$ = GetSymbolValue(SYM_STF_CWDDIR$)
  4065.    rc& = ReadSerialNumber(snpath$,buf1$)
  4066.    If rc& = 0 Then
  4067.       SetSymbolValue SYM_SERIALNUM$, NullTrim(buf1$)
  4068.       Lot_ReadSerialNumber = SUCCESS
  4069.    Else
  4070.       ErrorMsg SID_ERR_READSERIAL, ""
  4071.       Lot_ReadSerialNumber = FAILURE
  4072.    end if 
  4073.  
  4074. END FUNCTION
  4075.  
  4076. '*************************************************************************
  4077. '** PUBLIC FUNCTION Lot_TrimEndSlash (path$) AS STRING
  4078. '**
  4079. '** Purpose:   trims 
  4080. '** Author:    MMETH
  4081. '** Arguments: path$
  4082. '** Returns:   the modified path
  4083. '*************************************************************************
  4084.  
  4085. PUBLIC FUNCTION Lot_TrimEndSlash (path$) AS STRING
  4086.  
  4087.    DIM l%
  4088.  
  4089.    l% = LEN(path$)
  4090.    If l% <> 0 THEN
  4091.       If MID$(path$, l%, 1) = "\" Then
  4092.     Lot_TrimEndSlash = LEFT$ (path$, l%-1)
  4093.       Else
  4094.     Lot_TrimEndSlash = path$
  4095.       End If
  4096.    End If
  4097.  
  4098. END FUNCTION
  4099.  
  4100. PUBLIC FUNCTION Lot_AreShareToolsSupported () AS INTEGER
  4101. '** Purpose:    Finds if any of the registered products supports share
  4102. '** Author:     MZ
  4103. '** Arguments:  None
  4104. '** Returns:    1 if there is at least one product that supports share
  4105. '**             0 if none of the registered prods supports share or if 
  4106. '**             no products are registered
  4107. '*************************************************************************
  4108.    DIM NumberOfProducts%,count%,ShareSupport%
  4109.    DIM network$, prod$
  4110.  
  4111.    network$ = GetSymbolValue(SYM_NETWORK$)
  4112.    ShareSupport%=0
  4113.    ' Find how many products are registered
  4114.    NumberOfProducts%=Reg_GetNumberOfProducts()
  4115.    IF(NumberOfProducts%<>0) THEN
  4116.       ' Loop through the products
  4117.       FOR count%=1 TO NumberOfProducts%
  4118.      IF Reg_GetProdSupportForShare(count%)=1 THEN
  4119.                 prod$ = Reg_GetProductAcronym(count%)
  4120.             IF network$ = gNODE$  THEN
  4121.                 If  prod$ <> "SUIT" THEN
  4122.                     prod$ = prod$ + gTOP$
  4123.                     If Lot_IsTheFeatureInstalled (prod$) = 1 Then
  4124.                     ShareSupport%=1
  4125.                     EXIT FOR
  4126.                     End If
  4127.                 End If
  4128.             ELSE
  4129.             ShareSupport%=1
  4130.             EXIT FOR
  4131.             END IF    
  4132.      END IF
  4133.       NEXT
  4134.    END IF
  4135.    Lot_AreShareToolsSupported=ShareSupport%
  4136. END FUNCTION
  4137.  
  4138. PUBLIC FUNCTION Lot_AreShare32ToolsSupported () AS INTEGER
  4139. '** Purpose:    Finds if any of the registered products supports share32
  4140. '** Author:     MZ
  4141. '** Arguments:  None
  4142. '** Returns:    1 if there is at least one product that supports share32
  4143. '**             0 if none of the registered prods supports share32 or if 
  4144. '**             no products are registered
  4145. '*************************************************************************
  4146.    DIM NumberOfProducts%,count%,Share32Support%
  4147.  
  4148.    Share32Support%=0
  4149.    ' Find how many products are registered
  4150.    NumberOfProducts%=Reg_GetNumberOfProducts()
  4151.    IF(NumberOfProducts%<>0) THEN
  4152.       ' Loop through the products
  4153.       FOR count%=1 TO NumberOfProducts%
  4154.      IF Reg_GetProdSupportForShare32(count%)=1 THEN
  4155.         Share32Support%=1
  4156.         EXIT FOR
  4157.      END IF
  4158.       NEXT
  4159.    END IF
  4160.    Lot_AreShare32ToolsSupported=Share32Support%
  4161. END FUNCTION
  4162.  
  4163. PUBLIC Lot_CallShareExec_RC%
  4164. PUBLIC FUNCTION Lot_CallSharedTool (func$) AS INTEGER
  4165. '** Purpose:    Simply calls a shared function through EXECUTE
  4166. '**             if share is loaded.  Using EXECUTE allows us to
  4167. '**             not load SHARE.LSS
  4168. '** Author:     MMETH
  4169. '** Arguments:  func$ the function to call.
  4170. '** Returns:    Whatever the function returns.
  4171. '**             
  4172. '*************************************************************************
  4173. DIM notused%
  4174.    Lot_CallSharedTool = 0
  4175.    IF Lot_AreShareToolsSupported () = 1 OR _
  4176.       Lot_AreShare32ToolsSupported () = 1 THEN
  4177.       'notused% = DOEXEC (("SHARE"), (prodcall$))
  4178.       gEndStatementEncountered% = FALSE
  4179.       EXECUTE(|USE "SHARE": sub initialize: Lot_CallShareExec_RC% =| & func$ & |:end sub|)
  4180.       'EXECUTE(|USE "SHARE" : Lot_CallShareExec_RC% = | & func$)
  4181.  
  4182.       '  this gEndStatementEncountered flag is necessary because the Lotus
  4183.       '  END statement, which normally exists the entire program, only
  4184.       '  exits the top-level routine running in DOEXEC.  So,
  4185.       '  check this flag here, to see if we hit an END during DOEXEC.
  4186.  
  4187.       IF gEndStatementEncountered% = TRUE THEN
  4188.      END                       ' exit the program
  4189.       END IF
  4190.  
  4191.       Lot_CallSharedTool = Lot_CallShareExec_RC%
  4192.    END IF
  4193.  
  4194. END FUNCTION
  4195.  
  4196.  
  4197. PUBLIC SUB SetRestartDir (szDir$) 
  4198. '** Purpose:
  4199. '** Author:
  4200. '** Arguments:
  4201. '** Returns:
  4202. '**     
  4203. '*************************************************************************
  4204.     ' This part doesn't really work any way.
  4205.     IF FSetRestartDir(szDir$) = FALSE THEN
  4206.     ErrorMsg SID_ERR_SETRESTARTDIR, ""
  4207.     ERROR STFQUIT
  4208.     END IF
  4209.  
  4210. END SUB
  4211.  
  4212. PUBLIC FUNCTION RestartListEmpty  AS INTEGER
  4213. '** Purpose:
  4214. '** Author:
  4215. '** Arguments:
  4216. '** Returns:
  4217. '**     
  4218. '*************************************************************************
  4219.  
  4220.     IF CInt(FRestartListEmpty()) = FALSE THEN
  4221.     RestartListEmpty = FALSE
  4222.     ELSE
  4223.     RestartListEmpty = TRUE
  4224.     END IF
  4225.  
  4226. END FUNCTION
  4227.  
  4228. PUBLIC FUNCTION ExitExecRestart  AS INTEGER
  4229. '** Purpose:
  4230. '** Author:
  4231. '** Arguments:
  4232. '** Returns:
  4233. '**     
  4234. '*************************************************************************
  4235.  
  4236.     ExitExecRestart = CInt(FExitExecRestart())
  4237.  
  4238. END FUNCTION
  4239.  
  4240.  
  4241. '** FUNCTION Lot_WhereIsFeature(prodno%, featureId$, filetolookfor$) AS STRING
  4242. '**            
  4243. '** Purpose:   THis function will return the location of the destdir
  4244. '**            for the section, if the feature is installed.
  4245. '**            This function should **NOT** be used before PostCopyConfig.
  4246. '**            In a node situation it can be used during PreCopyConfig for
  4247. '**            shared components ** only! **
  4248. '**            This function can be used for standard, node, and server. Later
  4249. '**            will provide directory suuport on CDs also. Clients should use this function
  4250. '**            heavily! Make sure to check for empty string return "".
  4251. '**
  4252. '**            This function assumes: 
  4253. '**            1. The feature you are looking for exists in the INF file
  4254. '**                 if it doesn't, then we will always report back "" since
  4255. '**                 we depend upon the inf to find the destination directory
  4256. '**            2. The location of the feature relative to the top level
  4257. '**               product directory is identical for server and node!
  4258. '**            
  4259. '**            3. all files that can be found on the server using this
  4260. '**               functions must reside somewher under the main product directory
  4261. '**
  4262. '**            If clients use this function heavily, the transition to CD's
  4263. '**            and Toolkit supported node options will be smooth.
  4264. '**
  4265. '** Author:    MARCEL METH
  4266. '**
  4267. '** Arguments:    prodno%: The product that we are looking for.
  4268. '**            FeatureId$: which is the name of the keyword ID as it appears
  4269. '**                        in the INF FILE.
  4270. '**        filetolookfor$: a file in this section that we can use to
  4271. '**                        confirm that we found the feature.
  4272. '** Returns:   returns the directory where the feature can be found or ""
  4273. '**            If it can't be found.
  4274. '*************************************************************************
  4275. PUBLIC FUNCTION Lot_WhereIsFeature(prodno%, featureId$, filetolookfor$) AS STRING
  4276.    DIM network$, dirsym$, chpt$, destdir$,s$,InorOut%,subdir$,installIniFile$
  4277.    
  4278.    network$ = GetSymbolValue(SYM_NETWORK$)
  4279.    s$ = GetSymbolValue(SYM_SINGLESMARTSUITE$)
  4280.  
  4281.    '***Processing Suit
  4282.    '******************
  4283.    IF s$ = gSMARTSUITE$ THEN
  4284.  
  4285.       '***Processing Suit Standard
  4286.       IF network$ = gSTANDARD$ THEN
  4287.      IF Lot_IsTheFeatureInstalled(featureId$) = 0 GOTO MAYBESUITCD
  4288.      '***Get the chapter
  4289.      chpt$ = Lot_GetChapterFromKeyWord(featureId$)
  4290.      IF chpt$ = "" GOTO NOFEATURE
  4291.      '***Get if the feature was installed
  4292.      InorOut% = Lot_GetChapterValInt(chpt$, F_INOROUT)
  4293.      IF InorOut%=0 GOTO MAYBESUITCD
  4294.      '***Get the destination symbol
  4295.      dirsym$ = Lot_GetChapterValStr(chpt$, F_DESTDIRSYM)
  4296.      IF dirsym$ = "" GOTO NOFEATURE
  4297.      '***Get the destination directory
  4298.      destdir$ = GetSymbolValue(dirsym$)
  4299.      IF destdir$ = "" GOTO NOFEATURE
  4300.      IF DoesFileExist(destdir$+filetolookfor$,femExists) = 0 GOTO MAYBESUITCD
  4301.      '***Get the destination of the feature
  4302.      Lot_WhereIsFeature = destdir$
  4303.      EXIT FUNCTION
  4304.  
  4305.  
  4306.       '***Processing Suit Node
  4307.       ELSEIF network$ = gNODE$ THEN
  4308.      IF Lot_IsTheFeatureInstalled(featureId$) = 0 GOTO MAYBESUITCD
  4309.      '***Get the chapter
  4310.      chpt$ = Lot_GetChapterFromKeyWord(featureId$)
  4311.      '***Look on the node
  4312.      IF chpt$ <> "" THEN
  4313.         '***Get if the feature was installed
  4314.         InorOut% = Lot_GetChapterValInt(chpt$, F_INOROUT)
  4315.         IF InorOut%=0 GOTO LOOKONSUITSRV
  4316.         '***Get the destination directory
  4317.         dirsym$ = Lot_GetChapterValStr(chpt$, F_DESTDIRSYM)
  4318.         destdir$ = GetSymbolValue(dirsym$)
  4319.         IF DoesFileExist(destdir$+filetolookfor$,femExists) <> 0 THEN 
  4320.            '***Returns the destination of the feature
  4321.            Lot_WhereIsFeature = destdir$
  4322.            EXIT FUNCTION
  4323.         ELSE 
  4324.            GOTO LOOKONSUITSRV
  4325.         END IF
  4326.      ELSE 
  4327.         GOTO LOOKONSUITSRV
  4328.      END IF
  4329.  
  4330.  
  4331.       '***Processing Suit Server
  4332.       ELSEIF network$ = gSERVER$ THEN
  4333.      IF Lot_IsTheFeatureInstalled(featureId$) = 0 GOTO MAYBESUITCD
  4334.      '***Get the chapter
  4335.      chpt$ = Lot_GetChapterFromKeyWord(featureId$)
  4336.      IF chpt$ = "" GOTO MAYBESUITCD
  4337.      '***Get if the feature was installed
  4338.      InorOut% = Lot_GetChapterValInt(chpt$, F_INOROUT)
  4339.      IF InorOut%=0 GOTO MAYBESUITCD
  4340.      '***Get the destination symbol
  4341.      dirsym$ = Lot_GetChapterValStr(chpt$, F_DESTDIRSYM)
  4342.      IF dirsym$ = "" GOTO MAYBESUITCD
  4343.      '***Get the destination directory
  4344.      destdir$ = GetSymbolValue(dirsym$)
  4345.      IF DoesFileExist(destdir$+filetolookfor$,femExists) = 0 GOTO MAYBESUITCD
  4346.      '***Get the destination of the feature
  4347.      Lot_WhereIsFeature = destdir$
  4348.      EXIT FUNCTION
  4349.  
  4350.  
  4351.       '***Processing Suit Distribution
  4352.       ELSE  
  4353.      GOTO NOFEATURE
  4354.       END IF
  4355.  
  4356.    '***Processing Single product
  4357.    '****************************
  4358.    ELSEIF s$ = gSINGLE$ THEN
  4359.  
  4360.       '***Processing Single Product Standard
  4361.       IF network$ = gSTANDARD$ THEN
  4362.      IF Lot_IsTheFeatureInstalled(featureId$) = 0 GOTO MAYBESINGLECD
  4363.      '***Get the chapter
  4364.      chpt$ = Lot_GetChapterFromKeyWord(featureId$)
  4365.      IF chpt$ = "" GOTO NOFEATURE
  4366.      '***Get if the feature was installed
  4367.      InorOut% = Lot_GetChapterValInt(chpt$, F_INOROUT)
  4368.      IF InorOut%=0 GOTO MAYBESINGLECD
  4369.      '***Get the destination symbol
  4370.      dirsym$ = Lot_GetChapterValStr(chpt$, F_DESTDIRSYM)
  4371.      IF dirsym$ = "" GOTO NOFEATURE
  4372.      '***Get the destination directory
  4373.      destdir$ = GetSymbolValue(dirsym$)
  4374.      IF destdir$ = "" GOTO NOFEATURE
  4375.      IF DoesFileExist(destdir$+filetolookfor$,femExists) = 0 GOTO MAYBESINGLECD
  4376.      '***Get the destination of the feature
  4377.      Lot_WhereIsFeature = destdir$
  4378.      EXIT FUNCTION
  4379.  
  4380.       '***Processing Single Product Node
  4381.       ELSEIF network$ = gNODE$ THEN
  4382.      IF Lot_IsTheFeatureInstalled(featureId$) = 0 GOTO MAYBESINGLECD
  4383.      '***Get the chapter
  4384.      chpt$ = Lot_GetChapterFromKeyWord(featureId$)
  4385.      '***Look on the node
  4386.      IF chpt$ <> "" THEN
  4387.         '***Get if the feature was installed
  4388.         InorOut% = Lot_GetChapterValInt(chpt$, F_INOROUT)
  4389.         IF InorOut%=0 GOTO LOOKONSINGLESRV
  4390.         '***Get the destination directory
  4391.         dirsym$ = Lot_GetChapterValStr(chpt$, F_DESTDIRSYM)
  4392.         destdir$ = GetSymbolValue(dirsym$)
  4393.         IF DoesFileExist(destdir$+filetolookfor$,femExists) <> 0 THEN 
  4394.            '***Returns the destination of the feature
  4395.            Lot_WhereIsFeature = destdir$
  4396.            EXIT FUNCTION
  4397.         ELSE 
  4398.            GOTO LOOKONSINGLESRV
  4399.         END IF
  4400.      ELSE 
  4401.         GOTO LOOKONSINGLESRV
  4402.      END IF
  4403.  
  4404.        '***Processing Single Product Server
  4405.       ELSEIF network$ = gSERVER$ THEN
  4406.      IF Lot_IsTheFeatureInstalled(featureId$) = 0 GOTO MAYBESINGLECD
  4407.      '***Get the chapter
  4408.      chpt$ = Lot_GetChapterFromKeyWord(featureId$)
  4409.      IF chpt$ = "" GOTO MAYBESINGLECD
  4410.      '***Get if the feature was installed
  4411.      InorOut% = Lot_GetChapterValInt(chpt$, F_INOROUT)
  4412.      IF InorOut%=0 GOTO MAYBESINGLECD
  4413.      '***Get the destination symbol
  4414.      dirsym$ = Lot_GetChapterValStr(chpt$, F_DESTDIRSYM)
  4415.      IF dirsym$ = "" GOTO MAYBESINGLECD
  4416.      '***Get the destination directory
  4417.      destdir$ = GetSymbolValue(dirsym$)
  4418.      IF DoesFileExist(destdir$+filetolookfor$,femExists) = 0 GOTO MAYBESINGLECD
  4419.      '***Get the destination of the feature
  4420.      Lot_WhereIsFeature = destdir$
  4421.      EXIT FUNCTION
  4422.  
  4423.       '***Processing Single Product Distribution
  4424.       ELSE  
  4425.      GOTO NOFEATURE
  4426.       END IF
  4427.    END IF
  4428.  
  4429.  
  4430.    Exit Function
  4431.    LOOKONSINGLESRV:
  4432.       destdir$ = GetSymbolValue(SYM_INSTALL_SOURCE$)
  4433.       IF destdir$ = ""  THEN  destdir$ = GetSymbolValue(SYM_STF_SRCDIR$)
  4434.       IF DoesFileExist(destdir$+filetolookfor$,femExists) = 0 GOTO LOOKONNETLOTUSAPP
  4435.       Lot_WhereIsFeature = destdir$
  4436.       EXIT FUNCTION
  4437.  
  4438.    LOOKONSUITSRV:
  4439.       destdir$ = GetSymbolValue(SYM_INSTALL_SOURCE$)
  4440.       IF destdir$ = ""  THEN  destdir$ = GetSymbolValue(SYM_STF_SRCDIR$)
  4441.       installIniFile$ = MakePath(destdir$,gINSTALLINI$)
  4442.       subdir$ = GetIniKeyString(installIniFile$,"Destination Directories", Reg_GetProductAcronym(prodno%))
  4443.       IF DoesFileExist(destdir$+subdir$+filetolookfor$,femExists) = 0 GOTO LOOKONNETLOTUSAPP
  4444.       Lot_WhereIsFeature = destdir$+subdir$
  4445.       EXIT FUNCTION
  4446.  
  4447.    LOOKONNETLOTUSAPP:
  4448.       destdir$ = GetSymbolValue(SYM_NETLOTUSAPP$)
  4449.       IF DoesFileExist(destdir$+filetolookfor$,femExists) = 0 GOTO LOOKONNETCOMPONENT
  4450.       Lot_WhereIsFeature = destdir$
  4451.       EXIT FUNCTION
  4452.  
  4453.    LOOKONNETCOMPONENT:
  4454.       destdir$ = GetSymbolValue(SYM_NETCOMPONENT$)
  4455.       IF DoesFileExist(destdir$+filetolookfor$,femExists) = 0 GOTO NOFEATURE
  4456.       Lot_WhereIsFeature = destdir$
  4457.       EXIT FUNCTION
  4458.  
  4459.    MAYBESINGLECD:
  4460.       ''** MMETH WORK TO DO FOR CD; have a CDROOT symbol
  4461.    MAYBESUITCD:
  4462.       ''** MMETH WORK TO DO FOR CD; have a CDROOT symbol
  4463.  
  4464.    NOFEATURE:        
  4465.       Lot_WhereIsFeature = ""
  4466.  
  4467. END FUNCTION
  4468.  
  4469.  
  4470. PUBLIC FUNCTION Lot_IsTheFeatureInstalled(FeatureToFind$) AS INTEGER
  4471. '** Purpose:   Reads the chapters installed by the network  administrator 
  4472. '**            during server install into install.ini in the section
  4473. '**            [Server Feature Installed] and if the feature 
  4474. '**            was installed  returns 1 if not returns 0
  4475. '** Author:    MZ
  4476. '** Arguments: featureToFind$
  4477. '** Returns:   1 YES
  4478. '**            0 NO
  4479. '*************************************************************************
  4480.    DIM NetworkIns$ 
  4481.  
  4482.    'Identify if I am in node or server install
  4483.    NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  4484.  
  4485.    PopulateCINSTALLLIST
  4486.  
  4487.    IF NetworkIns$ <> gDISTRIBUTION THEN
  4488.  
  4489.       If ISELEMENT(CINSTALL(FeatureToFind$)) <> FALSE Then
  4490.      Lot_IsTheFeatureInstalled = 1
  4491.       Else
  4492.      Lot_IsTheFeatureInstalled = 0
  4493.       End If
  4494.    Else
  4495.       Lot_IsTheFeatureInstalled = 0
  4496.    End If
  4497.  END FUNCTION
  4498.  
  4499. PUBLIC FUNCTION Lot_SaveFeaturesInstaledInInstallIni() AS INTEGER
  4500. '** Purpose:   Saves the Features installed by the network  administrator 
  4501. '**            during server install into install.ini in the section
  4502. '**            [Server Feature Installed];  This is needed at Node
  4503. '**            install time
  4504. '**            MMETH added: Also save during standard so that
  4505. '**                         we have a record for standard install
  4506. '**            MZ    Added: save [Destination Directories] needed by Node
  4507. '**                         suit install
  4508. '** Author:    MZ
  4509. '** Arguments: None
  4510. '** Returns:   SUCCESS
  4511. '*************************************************************************
  4512.    DIM NetworkIns$, prodDir$, gInstallIniFile$, CurrChpt$, FeatureName$
  4513.    DIM FeatureNum%,s$,AllProdNum%,prodNum%,ProdAcronym$,BaseDir$,symList$
  4514.    DIM prodsym$,progdir$
  4515.    DIM installkind$
  4516.  
  4517.    'Identify if I am in server or standard install
  4518.    NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  4519.    IF NetworkIns$=gSERVER$ OR NetworkIns$=gSTANDARD THEN
  4520.  
  4521.       'Built the path to install.ini
  4522.       prodDir$ = Lot_GetInstallDir()
  4523.       gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  4524.  
  4525.       PopulateCINSTALLLIST
  4526.  
  4527.       'Loop through the chapters and log the features
  4528.      CurrChpt$ = Lot_GetFirst("", F_INOROUT) 
  4529.      WHILE (CurrChpt$ <> "")
  4530.     'Log all installed chapters
  4531.     FeatureName$ = Lot_GetChapterValStr(CurrChpt$, F_KEYWORD)
  4532.     If ISELEMENT(CINSTALL(FeatureName$)) = FALSE Then
  4533.        FeatureNum% = gNCINSTALL%    'Lot_GetLastFeatureNumber()
  4534.        CreateIniKeyValue gInstallIniFile$, "Server Feature Installed", "Feature"+LTRIM$(STR$(FeatureNum%+1)),FeatureName$, cmoOverwrite
  4535.        CINSTALL (FeatureName$) = "1"
  4536.        gNCINSTALL% = gNCINSTALL%+1
  4537.     END IF
  4538.     CurrChpt$ = Lot_GetNext() 
  4539.      WEND       
  4540.  
  4541.    END IF
  4542.    s$ = GetSymbolValue(SYM_SINGLESMARTSUITE$)
  4543.  
  4544.    'Identify if I am in server and suit install
  4545.     IF NetworkIns$=gSERVER$ AND s$ = gSMARTSUITE$ THEN
  4546.       'Loop through the products and log the directories
  4547.         AllProdNum% = 0
  4548.         AllProdNum% = Reg_GetNumberOfProducts()
  4549.         IF AllProdNum% <> 0 THEN
  4550.             BaseDir$= GetSymbolValue(SYM_BASEDIR$)
  4551.             FOR prodNum%=1 TO AllProdNum%
  4552.                 ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  4553.                 'Get the directory symbol
  4554.                 symList$ = Reg_GetDirSymbolList(prodNum%)
  4555.                 prodsym$ = GetListItem(symList$, 1)
  4556.                 progdir$ = GetListItem(prodsym$,1)
  4557.                 IF LEN(BaseDir$) < LEN(progdir$) THEN
  4558.                     CreateIniKeyValue gInstallIniFile$, "Destination Directories", ProdAcronym$,MID(progdir$,LEN(BaseDir$)+1), cmoOverwrite
  4559.                 END IF
  4560.             NEXT
  4561.       END IF
  4562.  
  4563.    END IF
  4564.  
  4565.    installkind$ = GetSymbolValue(SYM_INSTALLKIND$)
  4566.     'If we're a server, always write directories
  4567.     'Otherwise, write only if NOT a language install so that uninstall can work
  4568.     'correctly on the primary language
  4569.     IF NetworkIns$ = gSERVER$ OR installkind$ <> gLANGUAGEINSTALL$ THEN
  4570.    'write all destination symbols and their values
  4571.    Lot_WriteDestinationSymAndVal gInstallIniFile$, "Destination Symbols And Values" 
  4572.    Lot_WriteCriticalDirectories gInstallIniFile$
  4573.    IF GetSymbolValue(SYM_PARENTDIR$) <>"" THEN
  4574.       CreateIniKeyValue gInstallIniFile$, _
  4575.             "Destination Symbols And Values", _
  4576.             "ParentDir",GetSymbolValue(SYM_PARENTDIR$),_
  4577.             cmoOverwrite
  4578.    ELSE
  4579.       CreateIniKeyValue gInstallIniFile$, _
  4580.             "Destination Symbols And Values", _
  4581.             "ParentDir","", cmoOverwrite
  4582.    END IF
  4583.    END IF
  4584.  
  4585.    Lot_SaveFeaturesInstaledInInstallIni = SUCCESS
  4586. END FUNCTION
  4587.  
  4588. '*************************************************************************
  4589.  
  4590. PUBLIC FUNCTION Lot_SaveFeaturesInstaledInInstNodeIni() AS INTEGER
  4591. '** Purpose:   Saves the Features installed by the network  administrator 
  4592. '**            during server install into install.ini in the section
  4593. '**            [Server Feature Installed];  This is needed at Node
  4594. '**            install time
  4595. '**            MMETH added: Also save during standard so that
  4596. '**                         we have a record for standard install
  4597. '**            MZ    Added: save [Destination Directories] needed by Node
  4598. '**                         suit install
  4599. '** Author:    TV
  4600. '** Arguments: None
  4601. '** Returns:   SUCCESS
  4602. '*************************************************************************
  4603.    DIM NetworkIns$, prodDir$, gInstNodeIniFile$, CurrChpt$, FeatureName$
  4604.    DIM FeatureNum%,s$,AllProdNum%,prodNum%,ProdAcronym$,BaseDir$,symList$
  4605.    DIM prodsym$,progdir$, dirSym$, inidir$
  4606.  
  4607.    'Identify if I am in server or standard install
  4608.    NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  4609.    IF NetworkIns$=gNODE THEN
  4610.       'Built the path to cinstnod.ini
  4611.     dirSym$ = Reg_GetDirSymbolList(1)       '** First product dir list
  4612.     IF GetListLength(dirSym$) >= 1 THEN
  4613.         dirSym$ = GetListItem(dirSym$, 1)    '** First directory symbol
  4614.         inidir$ = GetSymbolValue(dirSym$) 
  4615.               gInstNodeIniFile$ = MakePath(inidir$,"cinstnod.ini")
  4616.     END IF
  4617.  
  4618.  
  4619.       PopulateCINSTNODELIST
  4620.  
  4621.       'Loop through the chapters and log the features
  4622.      CurrChpt$ = Lot_GetFirst("", F_INOROUT) 
  4623.      WHILE (CurrChpt$ <> "")
  4624.     'Log all installed chapters
  4625.     FeatureName$ = Lot_GetChapterValStr(CurrChpt$, F_KEYWORD)
  4626.     If ISELEMENT(CINSTNODE(FeatureName$)) = FALSE Then
  4627.        FeatureNum% = gNCINSTNODE%    'Lot_GetLastFeatureNumber()
  4628.        CreateIniKeyValue gInstNodeIniFile$, "Server Feature Installed", "Feature"+LTRIM$(STR$(FeatureNum%+1)),FeatureName$, cmoOverwrite
  4629.        CINSTNODE (FeatureName$) = "1"
  4630.        gNCINSTNODE% = gNCINSTNODE%+1
  4631.     END IF
  4632.     CurrChpt$ = Lot_GetNext() 
  4633.      WEND       
  4634.  
  4635.    END IF
  4636.    's$ = GetSymbolValue(SYM_SINGLESMARTSUITE$)
  4637.  
  4638.  
  4639.    'write all destination symbols and their values
  4640.    Lot_WriteDestinationSymAndVal gInstNodeIniFile$, "Destination Symbols And Values" 
  4641.    Lot_WriteCriticalDirectories gInstNodeIniFile$
  4642.    IF GetSymbolValue(SYM_PARENTDIR$) <>"" THEN
  4643.       CreateIniKeyValue gInstNodeIniFile$, _
  4644.             "Destination Symbols And Values", _
  4645.             "ParentDir",GetSymbolValue(SYM_PARENTDIR$),_
  4646.             cmoOverwrite
  4647.    ELSE
  4648.       CreateIniKeyValue gInstNodeIniFile$, _
  4649.             "Destination Symbols And Values", _
  4650.             "ParentDir","", cmoOverwrite
  4651.    END IF
  4652.  
  4653.    Lot_SaveFeaturesInstaledInInstNodeIni = SUCCESS
  4654. END FUNCTION
  4655.  
  4656. '*************************************************************************
  4657.  
  4658. FUNCTION Lot_GetLastFeatureNumber() AS INTEGER
  4659. '** Purpose:   Reads the features installed by the network  administrator 
  4660. '**            so far in the section [Server Feature Installed] and returns 
  4661. '**            the last number
  4662. '** Author:    MZ
  4663. '** Returns:   last number
  4664. '*************************************************************************
  4665.    DIM NetworkIns$, prodDir$, gInstallIniFile$, FeaturePref$
  4666.    DIM FeatureTag$, FeatureID$, rc%, lrc&
  4667.    STATIC FeatureNumber%
  4668.  
  4669.    'Identify if I am in node or server install
  4670.    NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  4671.  
  4672.    IF NetworkIns$=gSERVER$ OR NetworkIns$=gSTANDARD$ THEN
  4673.  
  4674.       'Built the path to install.ini
  4675.       prodDir$ = Lot_GetInstallDir()
  4676.       gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  4677.  
  4678.       FeaturePref$ = "Feature"
  4679.       FeatureNumber%=1
  4680.       FeatureTag$=FeaturePref$+LTRIM$(STR$(FeatureNumber%))
  4681.       FeatureID$ = GetIniKeyString(gInstallIniFile$,"Server Feature Installed", FeatureTag$)
  4682. 'print gInstallIniFile$,"Server Feature Installed", FeatureTag$, FeatureID$, "XXX"
  4683.       lrc& = DoesFileExist(gInstallIniFile$,femExists)
  4684.       IF lrc& = 1 THEN
  4685.      IF FeatureID$ = "" THEN
  4686.         Lot_GetLastFeatureNumber = 0
  4687.         EXIT FUNCTION
  4688.      ELSE   
  4689.         WHILE (FeatureID$ <> "")
  4690.            FeatureNumber% = FeatureNumber% + 1
  4691.            FeatureTag$=FeaturePref$+LTRIM$(STR$(FeatureNumber%))
  4692.            FeatureID$ = GetIniKeyString(gInstallIniFile$,"Server Feature Installed", FeatureTag$)
  4693. 'print "in while","Server Feature Installed", FeatureTag$, FeatureID$, "XXX1"
  4694.         WEND
  4695.         Lot_GetLastFeatureNumber = FeatureNumber%-1
  4696. 'print"FeatureNum% in the loop for getLastFeatureNum",STR$(FeatureNumber%)
  4697.         EXIT FUNCTION
  4698.     END IF
  4699.      
  4700.      ELSE
  4701.     '** DND: Look into using ShowPathError here. We should tell the
  4702.     '**      user where we looked for install.ini
  4703.     FatalErrorMsg SID_ERR_INSTALLINI_MISSING, "", STFQUIT
  4704.     'DoMsgBox("INSTALL.INI is missing!!!! ",gInstallIniFile$ ,MB_OK)
  4705.      END IF
  4706.    END IF
  4707.  END FUNCTION
  4708. '*************************************************************************
  4709.  
  4710. PUBLIC FUNCTION Lot_SaveTheNodeOptionsInInstallIni() AS INTEGER
  4711. '** Purpose:   Saves the node options installed by the network  administrator 
  4712. '**            during server install into install.ini in the section
  4713. '**            [<Product acronym> Node Options];  This is needed at Node
  4714. '**            install time
  4715. '** Author:    MZ
  4716. '** Arguments: None
  4717. '** Returns:   SUCCESS
  4718. '*************************************************************************
  4719.    DIM NetworkIns$, prodDir$, gInstallIniFile$, OptName$
  4720.    DIM OptCount%, prodNum%, AllProdNum%, ProdAcronym$, AllOptNum%, OptNum%
  4721.  
  4722.    'Identify if I am in server install
  4723.    NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  4724.    IF NetworkIns$=gSERVER$ THEN
  4725.  
  4726.       'Built the path to install.ini
  4727.       prodDir$ = Lot_GetInstallDir()
  4728.       gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  4729.  
  4730.       'Loop through the products and log the node options
  4731.       AllProdNum% = 0
  4732.       AllProdNum% = Reg_GetNumberOfProducts()
  4733.       IF AllProdNum% <> 0 THEN
  4734.      FOR prodNum%=1 TO AllProdNum%
  4735.         AllOptNum% = 0
  4736.         AllOptNum% = Reg_GetNumofNodeOptions(prodNum%)
  4737.         IF AllOptNum% <> 0 THEN
  4738.            ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  4739.            'Loop though options
  4740.            FOR OptNum%=1 TO AllOptNum% 
  4741.           IF Reg_IsNodeOptionSelected(prodNum%,OptNum%)=STR(1) THEN
  4742.              OptName$ = Reg_GetNodeOptionStr(prodNum%,OptNum%)
  4743.              IF OptName$ <> "" AND FIsKeywordinCopyList (OptName$) <> FALSE THEN
  4744.             OptCount% = Lot_GetLastNodeOptNumber(ProdAcronym$)
  4745.             CreateIniKeyValue gInstallIniFile$, ProdAcronym$+" Node Options", "Option"+LTRIM$(STR$(OptCount%+1)),OptName$, cmoOverwrite
  4746.              END IF
  4747.           END IF
  4748.            NEXT
  4749.         END IF
  4750.  
  4751.      NEXT
  4752.       END IF
  4753.    END IF
  4754.    Lot_SaveTheNodeOptionsInInstallIni = SUCCESS
  4755. END FUNCTION
  4756. '*************************************************************************
  4757.  
  4758. FUNCTION Lot_GetLastNodeOptNumber(ProdAcronym$) AS INTEGER
  4759. '** Purpose:   Reads the node options installed by the network  administrator 
  4760. '**            so far in the section [<ProdAcronym$>+" Node Options"] and returns 
  4761. '**            the last number
  4762. '** Author:    MZ
  4763. '** Returns:   last number
  4764. '*************************************************************************
  4765.    DIM NetworkIns$, prodDir$, gInstallIniFile$
  4766.    DIM OptTag$, OptID$, OptPref$, lrc&
  4767.    STATIC OptNumber%
  4768.  
  4769.    'Identify if I am in node or server install
  4770.    NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  4771.  
  4772.    IF NetworkIns$=gSERVER$ THEN
  4773.  
  4774.       'Built the path to install.ini
  4775.       prodDir$ = Lot_GetInstallDir()
  4776.       gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  4777.  
  4778.       OptPref$ = "Option"
  4779.       OptNumber%=1
  4780.       OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  4781.       OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" Node Options", OptTag$)
  4782.       lrc& = DoesFileExist(gInstallIniFile$,femExists)
  4783.       IF lrc& = 1 THEN
  4784.      IF OptID$ = "" THEN
  4785.         Lot_GetLastNodeOptNumber = 0
  4786.         EXIT FUNCTION
  4787.      ELSE   
  4788.         WHILE (OptID$ <> "")
  4789.            OptNumber% = OptNumber% + 1
  4790.            OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  4791.            OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" Node Options", OptTag$)
  4792.         WEND
  4793.         Lot_GetLastNodeOptNumber = OptNumber%-1
  4794.         EXIT FUNCTION
  4795.     END IF
  4796.      
  4797.      ELSE
  4798.     '** DND: Look into using ShowPathError here. We should tell the
  4799.     '**      user where we looked for install.ini
  4800.     FatalErrorMsg SID_ERR_INSTALLINI_MISSING, "", STFQUIT
  4801.     'DoMsgBox("INSTALL.INI is missing!!!! ",gInstallIniFile$ ,MB_OK)
  4802.      END IF
  4803.    END IF
  4804.  END FUNCTION
  4805. '*************************************************************************
  4806.  
  4807. PUBLIC FUNCTION Lot_IsTheNodeOptionsAvailToNode(prodNum%,OptName$) AS INTEGER
  4808. '** Purpose:   Checks if the node options is available to node users
  4809. '**            by reading into install.ini in the section
  4810. '**            [<Product acronym> Node Options]; 
  4811. '** Author:    MZ
  4812. '** Arguments: None
  4813. '** Returns:   1 or 0 if it is or not available
  4814. '*************************************************************************
  4815.    DIM NetworkIns$, prodDir$, gInstallIniFile$, ProdAcronym$
  4816.    DIM OptTag$, OptID$, OptPref$, OptNumber%, rc%, lrc&
  4817.  
  4818.    'Identify if I am in node install
  4819.    NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  4820.    IF NetworkIns$=gNODE$ THEN
  4821.  
  4822.       'Built the path to install.ini
  4823.       prodDir$ = Lot_GetInstallDir()
  4824.       gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  4825.       ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  4826.       Lot_IsTheNodeOptionsAvailToNode = 0
  4827.  
  4828.       OptPref$ = "Option"
  4829.       OptNumber%=1
  4830.       OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  4831.       OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" Node Options", OptTag$)
  4832.       lrc& = DoesFileExist(gInstallIniFile$,femExists)
  4833.       IF lrc& = 1 THEN
  4834.      IF OptID$ = OptName$ THEN
  4835.         Lot_IsTheNodeOptionsAvailToNode = 1
  4836.         EXIT FUNCTION
  4837.      ELSE   
  4838.         WHILE (OptID$ <> "")
  4839.            IF OptID$ = OptName$ THEN
  4840.           Lot_IsTheNodeOptionsAvailToNode = 1
  4841.           EXIT FUNCTION
  4842.            END IF
  4843.            OptNumber% = OptNumber% + 1
  4844.            OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  4845.            OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" Node Options", OptTag$)
  4846.         WEND
  4847.         Lot_IsTheNodeOptionsAvailToNode = 0
  4848.         EXIT FUNCTION
  4849.     END IF
  4850.      
  4851.      ELSE
  4852.     '** DND: Look into using ShowPathError here. We should tell the
  4853.     '**      user where we looked for install.ini
  4854.     FatalErrorMsg SID_ERR_INSTALLINI_MISSING, "", STFQUIT
  4855.     'DoMsgBox("INSTALL.INI is missing!!!! ",gInstallIniFile$ ,MB_OK)
  4856.      END IF
  4857.    END IF
  4858.  END FUNCTION
  4859. '*************************************************************************
  4860.  
  4861. PUBLIC FUNCTION Lot_IsAnyNodeOptAvailToNode() AS INTEGER
  4862. '** Purpose:   Checks if any node options are available to node users
  4863. '**            by reading into install.ini in the section
  4864. '**            [<Product acronym> Node Options]; 
  4865. '** Author:    MZ
  4866. '** Arguments: None
  4867. '** Returns:   1 or 0 if it is or not available
  4868. '*************************************************************************
  4869.    DIM NetworkIns$, prodDir$, gInstallIniFile$, ProdAcronym$,NumOfProds%
  4870.    DIM OptTag$, OptID$, OptPref$, OptNumber%, rc%, lrc&, prodNum%
  4871.  
  4872.    'Identify if I am in node install
  4873.    NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  4874.    IF NetworkIns$=gNODE$ THEN
  4875.  
  4876.       'Built the path to install.ini
  4877.       prodDir$ = Lot_GetInstallDir()
  4878.       gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  4879.  
  4880.       'Get all the products registered
  4881.       NumOfProds% = Reg_GetNumberOfProducts()
  4882.       IF NumOfProds% = 0 THEN
  4883.      Lot_IsAnyNodeOptAvailToNode = 0
  4884.      EXIT FUNCTION
  4885.       END IF
  4886.  
  4887.       lrc& = DoesFileExist(gInstallIniFile$,femExists)
  4888.       IF lrc& = 1 THEN
  4889.      'Loop through the products
  4890.      FOR prodNum% = 1 TO NumOfProds%
  4891.         ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  4892.  
  4893.         OptPref$ = "Option"
  4894.         OptNumber%=1
  4895.         OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  4896.         OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" Node Options", OptTag$)
  4897.         IF OptID$ <> "" THEN
  4898.            Lot_IsAnyNodeOptAvailToNode = 1
  4899.            EXIT FUNCTION
  4900.        END IF
  4901.      NEXT 
  4902.      
  4903.       ELSE
  4904.      '** DND: Look into using ShowPathError here. We should tell the
  4905.      '**      user where we looked for install.ini
  4906.      FatalErrorMsg SID_ERR_INSTALLINI_MISSING, "", STFQUIT
  4907.      'DoMsgBox("INSTALL.INI is missing!!!! ",gInstallIniFile$ ,MB_OK)
  4908.       END IF
  4909.  
  4910.    END IF
  4911.  END FUNCTION
  4912. '*************************************************************************
  4913.  
  4914. PUBLIC FUNCTION Lot_AreNodeOptAvailToNodeForProd(prodNum%) AS INTEGER
  4915. '** Purpose:   Checks if any node options are available to node users
  4916. '**            for the prodNum%, by reading into install.ini in the section
  4917. '**            [<Product acronym> Node Options]; 
  4918. '** Author:    MZ
  4919. '** Arguments: None
  4920. '** Returns:   1 or 0 if it is or not available
  4921. '*************************************************************************
  4922.    DIM NetworkIns$, prodDir$, gInstallIniFile$, ProdAcronym$,NumOfProds%
  4923.    DIM OptTag$, OptID$, OptPref$, OptNumber%, rc%, lrc&
  4924.  
  4925.    'Identify if I am in node install
  4926.    NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  4927.    IF NetworkIns$=gNODE$ THEN
  4928.  
  4929.       'Built the path to install.ini
  4930.       prodDir$ = Lot_GetInstallDir()
  4931.       gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  4932.  
  4933.       lrc& = DoesFileExist(gInstallIniFile$,femExists)
  4934.       IF lrc& = 1 THEN
  4935.      ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  4936.      OptPref$ = "Option"
  4937.      OptNumber%=1
  4938.      OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  4939.      OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" Node Options", OptTag$)
  4940.      IF OptID$ <> "" THEN
  4941.         Lot_AreNodeOptAvailToNodeForProd = 1
  4942.         EXIT FUNCTION
  4943.      ELSE
  4944.         Lot_AreNodeOptAvailToNodeForProd = 0
  4945.         EXIT FUNCTION
  4946.      END IF
  4947.     
  4948.       ELSE
  4949.      '** DND: Look into using ShowPathError here. We should tell the
  4950.      '**      user where we looked for install.ini
  4951.      FatalErrorMsg SID_ERR_INSTALLINI_MISSING, "", STFQUIT
  4952.      'DoMsgBox("INSTALL.INI is missing!!!! ",gInstallIniFile$ ,MB_OK)
  4953.       END IF
  4954.  
  4955.    END IF
  4956.  END FUNCTION
  4957. '*************************************************************************
  4958.  
  4959. PUBLIC FUNCTION Lot_GetNumOfNodeOptAvailToNodeForProd(prodNum%) AS INTEGER
  4960. '** Purpose:   Counts the node options available to node users
  4961. '**            for the prodNum%, by reading into install.ini in the section
  4962. '**            [<Product acronym> Node Options]; 
  4963. '** Author:    MZ
  4964. '** Arguments: None
  4965. '** Returns:   0 or num of options
  4966. '*************************************************************************
  4967.    DIM NetworkIns$, prodDir$, gInstallIniFile$, ProdAcronym$,NumOfOptions%
  4968.    DIM OptTag$, OptID$, OptPref$, OptNumber%, rc%, lrc&
  4969.  
  4970.    'Identify if I am in node install
  4971.    NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  4972.    IF NetworkIns$=gNODE$ THEN
  4973.  
  4974.       'Built the path to install.ini
  4975.       prodDir$ = Lot_GetInstallDir()
  4976.       gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  4977.  
  4978.       lrc& = DoesFileExist(gInstallIniFile$,femExists)
  4979.       IF lrc& = 1 THEN
  4980.      ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  4981.      OptPref$ = "Option"
  4982.      OptNumber%=1
  4983.      OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  4984.      OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" Node Options", OptTag$)
  4985.      IF OptID$ <> "" THEN
  4986.         WHILE (OptID$ <> "")
  4987.            NumOfOptions% = OptNumber%
  4988.            OptNumber% = OptNumber% + 1
  4989.            OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  4990.            OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" Node Options", OptTag$)
  4991.         WEND
  4992.       ELSE
  4993.         Lot_GetNumOfNodeOptAvailToNodeForProd = 0
  4994.         EXIT FUNCTION
  4995.      END IF
  4996.      Lot_GetNumOfNodeOptAvailToNodeForProd = NumOfOptions
  4997.      EXIT FUNCTION
  4998.     
  4999.       ELSE
  5000.      '** DND: Look into using ShowPathError here. We should tell the
  5001.      '**      user where we looked for install.ini
  5002.      FatalErrorMsg SID_ERR_INSTALLINI_MISSING, "", STFQUIT
  5003.      'DoMsgBox("INSTALL.INI is missing!!!! ",gInstallIniFile$ ,MB_OK)
  5004.       END IF
  5005.  
  5006.    END IF
  5007.  END FUNCTION
  5008. '*************************************************************************
  5009.  
  5010. PUBLIC FUNCTION Lot_AreAnyNodeOptAvailToSrv() AS INTEGER
  5011. '** Purpose:   Checks the registration database to find the registred 
  5012. '**            node options
  5013. '** Author:    MZ
  5014. '** Arguments: None
  5015. '** Returns:   1 if there is at least 1 option or 0 if there is none
  5016. '*************************************************************************
  5017.    DIM NetworkIns$, prodDir$, gInstallIniFile$, OptName$, j%, nodeopt_flag%
  5018.    DIM OptCount%, prodNum%, AllProdNum%, ProdAcronym$, AllOptNum%, OptNum%
  5019.    DIM OptKeyword$, chpt$
  5020.  
  5021.    'Identify if I am in server install
  5022.    NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  5023.    IF NetworkIns$=gSERVER$ THEN
  5024.  
  5025.       'Built the path to install.ini
  5026.       prodDir$ = Lot_GetInstallDir()
  5027.       gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  5028.  
  5029.       'Loop through the products and check for node options
  5030.       AllProdNum% = 0
  5031.       nodeopt_flag% = 0
  5032.       AllProdNum% = Reg_GetNumberOfProducts()
  5033.       IF AllProdNum% <> 0 THEN
  5034.      FOR prodNum%=1 TO AllProdNum%
  5035.         AllOptNum% = 0
  5036.         AllOptNum% = Reg_GetNumofNodeOptions(prodNum%)
  5037.  
  5038. '            Reg_ReSetAllNodeOptsSelToDefaults prodNum%
  5039.         OptNum%=Reg_GetNumofNodeOptions(prodNum%)
  5040.      IF OptNum% <> 0 THEN
  5041.         chpt$ = Lot_GetChapterFromKeyword(Reg_GetProductAcronym(prodNum%) + gTOP$)
  5042.        ' Loop through the options
  5043.         FOR j% = 1 TO OptNum%
  5044.         OptKeyWord$ = Reg_GetNodeOptionStr(prodNum%,j%)
  5045.         chpt$ = Lot_GetChapterFromKeyword(OptKeyWord$)
  5046.         IF INT(Lot_GetChapterValInt(chpt$,F_INOROUT)) = 1 THEN
  5047.          nodeopt_flag% = 1
  5048.         END IF
  5049.         NEXT
  5050.      END IF
  5051.      
  5052.      IF AllOptNum% <> 0 AND nodeopt_flag% <> 0 THEN
  5053.            Lot_AreAnyNodeOptAvailToSrv=1
  5054.            EXIT FUNCTION
  5055.         END IF
  5056.      NEXT
  5057.       ELSE
  5058.      Lot_AreAnyNodeOptAvailToSrv=0
  5059.      EXIT FUNCTION
  5060.       END IF
  5061.    ELSE
  5062.       Lot_AreAnyNodeOptAvailToSrv=0
  5063.       EXIT FUNCTION
  5064.    END IF
  5065.  
  5066.    Lot_AreAnyNodeOptAvailToSrv=0
  5067. END FUNCTION
  5068. '*************************************************************************
  5069.  
  5070.  
  5071.  
  5072. PUBLIC FUNCTION Lot_SaveTheCDOptionsInInstallIni() AS INTEGER
  5073. '** Purpose:   Saves the CD options installed by the network  administrator 
  5074. '**            during server install into install.ini in the section
  5075. '**            [<Product acronym> CD Options];  This is needed at CD
  5076. '**            install time
  5077. '** Author:    MZ
  5078. '** Arguments: None
  5079. '** Returns:   SUCCESS
  5080. '*************************************************************************
  5081.    DIM NetworkIns$, prodDir$, gInstallIniFile$, OptName$
  5082.    DIM OptCount%, prodNum%, AllProdNum%, ProdAcronym$, AllOptNum%, OptNum%
  5083.  
  5084.    'Identify if I am in server install
  5085.    NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  5086.    IF NetworkIns$=gSERVER$ THEN
  5087.  
  5088.       'Built the path to install.ini
  5089.       prodDir$ = Lot_GetInstallDir()
  5090.       gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  5091.  
  5092.       'Loop through the products and log the CD options
  5093.       AllProdNum% = 0
  5094.       AllProdNum% = Reg_GetNumberOfProducts()
  5095.       IF AllProdNum% <> 0 THEN
  5096.      FOR prodNum%=1 TO AllProdNum%
  5097.         AllOptNum% = 0
  5098.         AllOptNum% = Reg_GetNumofCDOptions(prodNum%)
  5099.         IF AllOptNum% <> 0 THEN
  5100.            ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  5101.            'Loop though options
  5102.            FOR OptNum%=1 TO AllOptNum% 
  5103.           IF Reg_IsCDOptionSelected(prodNum%,OptNum%)=STR(1) THEN
  5104.              OptName$ = Reg_GetCDOptionStr(prodNum%,OptNum%)
  5105.              IF OptName$ <> "" AND FIsKeywordinCopyList (OptName$) <> FALSE THEN
  5106.             OptCount% = Lot_GetLastCDOptNumber(ProdAcronym$)
  5107.             CreateIniKeyValue gInstallIniFile$, ProdAcronym$+" CD Options", "Option"+LTRIM$(STR$(OptCount%+1)),OptName$, cmoOverwrite
  5108.              END IF
  5109.           END IF
  5110.            NEXT
  5111.         END IF
  5112.  
  5113.      NEXT
  5114.       END IF
  5115.    END IF
  5116.    Lot_SaveTheCDOptionsInInstallIni = SUCCESS
  5117. END FUNCTION
  5118. '*************************************************************************
  5119.  
  5120. FUNCTION Lot_GetLastCDOptNumber(ProdAcronym$) AS INTEGER
  5121. '** Purpose:   Reads the CD options installed by the network  administrator 
  5122. '**            so far in the section [<ProdAcronym$>+" CD Options"] and returns 
  5123. '**            the last number
  5124. '** Author:    MZ
  5125. '** Returns:   last number
  5126. '*************************************************************************
  5127.    DIM NetworkIns$, prodDir$, gInstallIniFile$
  5128.    DIM OptTag$, OptID$, OptPref$, rc%
  5129.    STATIC OptNumber%
  5130.  
  5131.    'Identify if I am in CD or server install
  5132.    NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  5133.  
  5134.    IF NetworkIns$=gSERVER$ THEN
  5135.  
  5136.       'Built the path to install.ini
  5137.       prodDir$ = Lot_GetInstallDir()
  5138.       gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  5139.  
  5140.       OptPref$ = "Option"
  5141.       OptNumber%=1
  5142.       OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5143.       OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" CD Options", OptTag$)
  5144.       IF DoesFileExist(gInstallIniFile$,femExists) = 1 THEN
  5145.      IF OptID$ = "" THEN
  5146.         Lot_GetLastCDOptNumber = 0
  5147.         EXIT FUNCTION
  5148.      ELSE   
  5149.         WHILE (OptID$ <> "")
  5150.            OptNumber% = OptNumber% + 1
  5151.            OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5152.            OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" CD Options", OptTag$)
  5153.         WEND
  5154.         Lot_GetLastCDOptNumber = OptNumber%-1
  5155.         EXIT FUNCTION
  5156.     END IF
  5157.      
  5158.      ELSE
  5159.     '** DND: Look into using ShowPathError here. We should tell the
  5160.     '**      user where we looked for install.ini
  5161.     FatalErrorMsg SID_ERR_INSTALLINI_MISSING, "", STFQUIT
  5162.     'DoMsgBox("INSTALL.INI is missing!!!! ",gInstallIniFile$ ,MB_OK)
  5163.      END IF
  5164.    END IF
  5165.  END FUNCTION
  5166. '*************************************************************************
  5167.  
  5168. PUBLIC FUNCTION Lot_IsTheCDOptionsAvailToNode(prodNum%,OptName$) AS INTEGER
  5169. '** Purpose:   Checks if the CD options is available to node users
  5170. '**            by reading into install.ini in the section
  5171. '**            [<Product acronym> CD Options]; 
  5172. '** Author:    MZ
  5173. '** Arguments: None
  5174. '** Returns:   1 or 0 if it is or not available
  5175. '*************************************************************************
  5176.    DIM NetworkIns$, prodDir$, gInstallIniFile$, ProdAcronym$
  5177.    DIM OptTag$, OptID$, OptPref$, OptNumber%, rc%
  5178.  
  5179.    'Identify if I am in node install
  5180.    NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  5181.    IF NetworkIns$=gNODE$ THEN
  5182.  
  5183.       'Built the path to install.ini
  5184.       prodDir$ = Lot_GetInstallDir()
  5185.       gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  5186.       ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  5187.       Lot_IsTheCDOptionsAvailToNode = 0
  5188.  
  5189.       OptPref$ = "Option"
  5190.       OptNumber%=1
  5191.       OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5192.       OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" CD Options", OptTag$)
  5193.       IF DoesFileExist(gInstallIniFile$,femExists) = 1 THEN
  5194.      IF OptID$ = OptName$ THEN
  5195.         Lot_IsTheCDOptionsAvailToNode = 1
  5196.         EXIT FUNCTION
  5197.      ELSE   
  5198.         WHILE (OptID$ <> "")
  5199.            IF OptID$ = OptName$ THEN
  5200.           Lot_IsTheCDOptionsAvailToNode = 1
  5201.           EXIT FUNCTION
  5202.            END IF
  5203.            OptNumber% = OptNumber% + 1
  5204.            OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5205.            OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" CD Options", OptTag$)
  5206.         WEND
  5207.         Lot_IsTheCDOptionsAvailToNode = 0
  5208.         EXIT FUNCTION
  5209.     END IF
  5210.      
  5211.      ELSE
  5212.     '** DND: Look into using ShowPathError here. We should tell the
  5213.     '**      user where we looked for install.ini
  5214.     FatalErrorMsg SID_ERR_INSTALLINI_MISSING, "", STFQUIT
  5215.     'DoMsgBox("INSTALL.INI is missing!!!! ",gInstallIniFile$ ,MB_OK)
  5216.      END IF
  5217.    END IF
  5218.  END FUNCTION
  5219. '*************************************************************************
  5220.  
  5221. PUBLIC FUNCTION Lot_IsAnyCDOptAvailToNode() AS INTEGER
  5222. '** Purpose:   Checks if any CD options are available to node users
  5223. '**            by reading into install.ini in the section
  5224. '**            [<Product acronym> CD Options]; 
  5225. '** Author:    MZ
  5226. '** Arguments: None
  5227. '** Returns:   1 or 0 if it is or not available
  5228. '*************************************************************************
  5229.    DIM NetworkIns$, prodDir$, gInstallIniFile$, ProdAcronym$,NumOfProds%
  5230.    DIM OptTag$, OptID$, OptPref$, OptNumber%, rc%,prodNum%
  5231.  
  5232.    'Identify if I am in node install
  5233.    NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  5234.    IF NetworkIns$=gNODE$ THEN
  5235.  
  5236.       'Built the path to install.ini
  5237.       prodDir$ = Lot_GetInstallDir()
  5238.       gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  5239.  
  5240.       'Get all the products registered
  5241.       NumOfProds% = Reg_GetNumberOfProducts()
  5242.       IF NumOfProds% = 0 THEN
  5243.      Lot_IsAnyCDOptAvailToNode = 0
  5244.      EXIT FUNCTION
  5245.       END IF
  5246.  
  5247.       IF DoesFileExist(gInstallIniFile$,femExists) = 1 THEN
  5248.      'Loop through the products
  5249.      FOR prodNum% = 1 TO NumOfProds%
  5250.         ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  5251.  
  5252.         OptPref$ = "Option"
  5253.         OptNumber%=1
  5254.         OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5255.         OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" CD Options", OptTag$)
  5256.         IF OptID$ <> "" THEN
  5257.            Lot_IsAnyCDOptAvailToNode = 1
  5258.            EXIT FUNCTION
  5259.        END IF
  5260.      NEXT 
  5261.      
  5262.       ELSE
  5263.      '** DND: Look into using ShowPathError here. We should tell the
  5264.      '**      user where we looked for install.ini
  5265.      FatalErrorMsg SID_ERR_INSTALLINI_MISSING, "", STFQUIT
  5266.      'DoMsgBox("INSTALL.INI is missing!!!! ",gInstallIniFile$ ,MB_OK)
  5267.       END IF
  5268.  
  5269.    END IF
  5270.  END FUNCTION
  5271. '*************************************************************************
  5272.  
  5273. PUBLIC FUNCTION Lot_AreCDOptAvailToNodeForProd(prodNum%) AS INTEGER
  5274. '** Purpose:   Checks if any CD options are available to node users
  5275. '**            for the prodNum%, by reading into install.ini in the section
  5276. '**            [<Product acronym> CD Options]; 
  5277. '** Author:    MZ
  5278. '** Arguments: None
  5279. '** Returns:   1 or 0 if it is or not available
  5280. '*************************************************************************
  5281.    DIM NetworkIns$, prodDir$, gInstallIniFile$, ProdAcronym$,NumOfProds%
  5282.    DIM OptTag$, OptID$, OptPref$, OptNumber%, rc%
  5283.  
  5284.    'Identify if I am in node install
  5285.    NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  5286.    IF NetworkIns$=gNODE$ THEN
  5287.  
  5288.       'Built the path to install.ini
  5289.       prodDir$ = Lot_GetInstallDir()
  5290.       gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  5291.  
  5292.       IF DoesFileExist(gInstallIniFile$,femExists) = 1 THEN
  5293.      ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  5294.      OptPref$ = "Option"
  5295.      OptNumber%=1
  5296.      OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5297.      OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" CD Options", OptTag$)
  5298.      IF OptID$ <> "" THEN
  5299.         Lot_AreCDOptAvailToNodeForProd = 1
  5300.         EXIT FUNCTION
  5301.      ELSE
  5302.         Lot_AreCDOptAvailToNodeForProd = 0
  5303.         EXIT FUNCTION
  5304.      END IF
  5305.     
  5306.       ELSE
  5307.      '** DND: Look into using ShowPathError here. We should tell the
  5308.      '**      user where we looked for install.ini
  5309.      FatalErrorMsg SID_ERR_INSTALLINI_MISSING, "", STFQUIT
  5310.      'DoMsgBox("INSTALL.INI is missing!!!! ",gInstallIniFile$ ,MB_OK)
  5311.       END IF
  5312.  
  5313.    END IF
  5314.  END FUNCTION
  5315. '*************************************************************************
  5316.  
  5317. PUBLIC FUNCTION Lot_GetNumOfCDOptAvailToNodeForProd(prodNum%) AS INTEGER
  5318. '** Purpose:   Counts the CD options available to node users
  5319. '**            for the prodNum%, by reading into install.ini in the section
  5320. '**            [<Product acronym> CD Options]; 
  5321. '** Author:    MZ
  5322. '** Arguments: None
  5323. '** Returns:   0 or num of options
  5324. '*************************************************************************
  5325.    DIM NetworkIns$, prodDir$, gInstallIniFile$, ProdAcronym$,NumOfOptions%
  5326.    DIM OptTag$, OptID$, OptPref$, OptNumber%, rc%
  5327.  
  5328.    'Identify if I am in node install
  5329.    NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  5330.    IF NetworkIns$=gNODE$ THEN
  5331.  
  5332.       'Built the path to install.ini
  5333.       prodDir$ = Lot_GetInstallDir()
  5334.       gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  5335.  
  5336.       IF DoesFileExist(gInstallIniFile$,femExists) = 1 THEN
  5337.      ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  5338.      OptPref$ = "Option"
  5339.      OptNumber%=1
  5340.      OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5341.      OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" CD Options", OptTag$)
  5342.      IF OptID$ <> "" THEN
  5343.         WHILE (OptID$ <> "")
  5344.            NumOfOptions% = OptNumber%
  5345.            OptNumber% = OptNumber% + 1
  5346.            OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5347.            OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" CD Options", OptTag$)
  5348.         WEND
  5349.       ELSE
  5350.         Lot_GetNumOfCDOptAvailToNodeForProd = 0
  5351.         EXIT FUNCTION
  5352.      END IF
  5353.      Lot_GetNumOfCDOptAvailToNodeForProd = NumOfOptions
  5354.      EXIT FUNCTION
  5355.     
  5356.       ELSE
  5357.      '** DND: Look into using ShowPathError here. We should tell the
  5358.      '**      user where we looked for install.ini
  5359.      FatalErrorMsg SID_ERR_INSTALLINI_MISSING, "", STFQUIT
  5360.      'DoMsgBox("INSTALL.INI is missing!!!! ",gInstallIniFile$ ,MB_OK)
  5361.       END IF
  5362.  
  5363.    END IF
  5364.  END FUNCTION
  5365. '*************************************************************************
  5366.  
  5367. PUBLIC FUNCTION Lot_AreAnyCDOptAvailToSrv() AS INTEGER
  5368. '** Purpose:   Checks the registration database to find the registred 
  5369. '**            CD options
  5370. '** Author:    MZ
  5371. '** Arguments: None
  5372. '** Returns:   1 if there is at least 1 option or 0 if there is none
  5373. '*************************************************************************
  5374.    DIM NetworkIns$, prodDir$, gInstallIniFile$, OptName$, j%, CDopt_flag%
  5375.    DIM OptCount%, prodNum%, AllProdNum%, ProdAcronym$, AllOptNum%, OptNum%
  5376.    DIM OptKeyword$, chpt$
  5377.  
  5378.    'Identify if I am in server install
  5379.    NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  5380.    IF NetworkIns$=gSERVER$ THEN
  5381.  
  5382.       'Built the path to install.ini
  5383.       prodDir$ = Lot_GetInstallDir()
  5384.       gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  5385.  
  5386.       'Loop through the products and check for CD options
  5387.       AllProdNum% = 0
  5388.       CDopt_flag% = 0
  5389.       AllProdNum% = Reg_GetNumberOfProducts()
  5390.       IF AllProdNum% <> 0 THEN
  5391.      FOR prodNum%=1 TO AllProdNum%
  5392.         AllOptNum% = 0
  5393.         AllOptNum% = Reg_GetNumofCDOptions(prodNum%)
  5394.  
  5395. '            Reg_ReSetAllCDOptsSelToDefaults prodNum%
  5396.         OptNum%=Reg_GetNumofCDOptions(prodNum%)
  5397.      IF OptNum% <> 0 THEN
  5398.         chpt$ = Lot_GetChapterFromKeyword(Reg_GetProductAcronym(prodNum%) + gTOP$)
  5399.        ' Loop through the options
  5400.         FOR j% = 1 TO OptNum%
  5401.         OptKeyWord$ = Reg_GetCDOptionStr(prodNum%,j%)
  5402.         chpt$ = Lot_GetChapterFromKeyword(OptKeyWord$)
  5403.         IF INT(Lot_GetChapterValInt(chpt$,F_INOROUT)) = 1 THEN
  5404.          CDopt_flag% = 1
  5405.         END IF
  5406.         NEXT
  5407.      END IF
  5408.      
  5409.      IF AllOptNum% <> 0 AND CDopt_flag% <> 0 THEN
  5410.            Lot_AreAnyCDOptAvailToSrv=1
  5411.            EXIT FUNCTION
  5412.         END IF
  5413.      NEXT
  5414.       ELSE
  5415.      Lot_AreAnyCDOptAvailToSrv=0
  5416.      EXIT FUNCTION
  5417.       END IF
  5418.    ELSE
  5419.       Lot_AreAnyCDOptAvailToSrv=0
  5420.       EXIT FUNCTION
  5421.    END IF
  5422.  
  5423.    Lot_AreAnyCDOptAvailToSrv=0
  5424. END FUNCTION
  5425. '*************************************************************************
  5426.  
  5427.  
  5428.  
  5429.  
  5430. '*************************************************************************
  5431. '** FUNCTION GetNotesPathfromLotusIni() AS STRING
  5432. '**
  5433. '** Purpose: Gets the notes dir path from Lotus.ini file, and searches for
  5434. '**          notes.exe in the product dir path. 
  5435. '**            
  5436. '** Author:    INSIK RHEE
  5437. '** Arguments: None
  5438. '** Returns:   if notes.exe does not exist in dir specified in lotus.ini, it
  5439. '**            returns "", otherwise returns the full path without filename.
  5440. '*************************************************************************
  5441.  
  5442.  
  5443. PUBLIC FUNCTION GetNotesPathfromLotusIni() AS STRING
  5444. DIM DestDir$, lotusinipath$, defdir$, temp%, ProdDir$, fullpath$, rv%
  5445.  
  5446.    DestDir$ = GetWindowsDir()
  5447.    lotusinipath$ = DestDir$ +"lotus.ini"
  5448.  
  5449.    if DoesFileExist(lotusinipath$,femExists) then
  5450.       defdir$ = GetIniKeyString(lotusinipath$,"Lotus Applications", "Notes")
  5451.       if defdir$ <> "" then
  5452.      temp% = INSTR(1,LCASE$(defdir$),"notes.exe")
  5453.      if temp% <> 0 then
  5454.         ProdDir$ = MID$(defdir$,1,(temp%-1))
  5455.         if ProdDir$ <> "" then
  5456.            fullpath$ = ProdDir$ + "notes.exe"
  5457.            if DoesFileExist(fullpath$, femExists) then
  5458.           GetNotesPathfromLotusIni = MID$(defdir$,1,(temp%-2))
  5459.           EXIT FUNCTION
  5460.            end if 
  5461.         end if 
  5462.      end if 
  5463.       end if 
  5464.    end if
  5465.  
  5466.    GetNotesPathfromLotusIni = ""
  5467.  
  5468. END FUNCTION
  5469.  
  5470. '*************************************************************************
  5471. '** FUNCTION IsNotesInPath AS INTEGER
  5472. '**
  5473. '** Purpose: Detects the presence of notes path in the autoexec.bat file
  5474. '**            
  5475. '** Author:    INSIK RHEE
  5476. '** Arguments: None
  5477. '** Returns:   1 if true, 0 if false.
  5478. '*************************************************************************
  5479.  
  5480. PUBLIC FUNCTION IsNotesInPath() AS INTEGER
  5481. DIM     notesdir$,autoexec$,Buffer$
  5482. DIM autofile%, FoundPath%
  5483.  
  5484.     notesdir$ = GetNotesPathfromLotusIni()
  5485.     IsNotesInPath = 0                                                                       ' default = FALSE
  5486.     if notesdir$ = "" then
  5487.         IsNotesInPath = 1
  5488.         EXIT FUNCTION
  5489.     end if
  5490.     autoexec$ = GetBootDrive() 
  5491.    IF autoexec$ <> "" THEN
  5492.       autoexec$ = autoexec$ + "autoexec.bat" 
  5493.    ELSE
  5494.       autoexec$ = "c:\" + "autoexec.bat"
  5495.    END IF
  5496.  
  5497.    autofile% = 111
  5498.     OPEN autoexec$ FOR INPUT AS autofile%
  5499.     Do Until EOF(autofile%)
  5500.         LINE INPUT #autofile%, Buffer$
  5501.         FoundPath% = INSTR(1,LCASE$(Buffer$), "path")
  5502.         if FoundPath% <> 0 Then                                                 ' path statement found.
  5503.             FoundPath% = INSTR(FoundPath%, LCASE$(Buffer$), LCASE$(notesdir$))
  5504.             if FoundPath% <> 0 Then 
  5505.                 IsNotesInPath = 1
  5506.                 CLOSE #autofile%
  5507.                 EXIT FUNCTION
  5508.             end if
  5509.         end if
  5510.     Loop
  5511.     CLOSE #autofile%
  5512.  
  5513. END FUNCTION
  5514.  
  5515. '*************************************************************************
  5516. '** FUNCTION IsShareInAUTOEXEC AS INTEGER
  5517. '**
  5518. '** Purpose: Detects the presence of SHARE.EXE in the autoexec.bat file
  5519. '**            
  5520. '** Author:    INSIK RHEE
  5521. '** Arguments: None
  5522. '** Returns:   1 if true, 0 if false.
  5523. '*************************************************************************
  5524.  
  5525. PUBLIC FUNCTION IsShareInAUTOEXEC() AS INTEGER
  5526. DIM   autoexec$,Buffer$
  5527. DIM   autofile%, FoundShare%
  5528.  
  5529.     IsShareInAUTOEXEC = 0                                                                   ' default = FALSE
  5530.    autoexec$ = GetBootDrive() 
  5531.    IF autoexec$ <> "" THEN
  5532.       autoexec$ = autoexec$ + "autoexec.bat" 
  5533.    ELSE
  5534.       autoexec$ = "c:\" + "autoexec.bat"
  5535.    END IF
  5536.  
  5537.     autofile% = 111
  5538.     OPEN autoexec$ FOR INPUT AS autofile%
  5539.     Do Until EOF(autofile%)
  5540.         LINE INPUT #autofile%, Buffer$
  5541.         FoundShare% = INSTR(1,LCASE$(Buffer$), "share")
  5542.         if FoundShare% <> 0 Then                                                        ' share statement found.
  5543.             IsShareInAUTOEXEC = 1
  5544.             CLOSE #autofile%
  5545.             EXIT FUNCTION
  5546.         end if
  5547.     Loop
  5548.    CLOSE #autofile%
  5549.  
  5550. END FUNCTION
  5551.  
  5552. '*************************************************************************
  5553. '** FUNCTION ModifyAutoexec AS STRING
  5554. '**
  5555. '** Purpose: Modifies autoexec.bat to include share and/or modify path to 
  5556. '**             include notes 
  5557. '**            
  5558. '** Author:    INSIK RHEE
  5559. '** Arguments:  modflag%        = bitwise flag on what to modify.
  5560. '**                             directmod%      = 1 to modify autoexec.bat (backing up old one)
  5561. '**                                                       0 to modify to a backup file 
  5562. '**                             backup$         = backup filename 
  5563. '** Returns:   NULL string if success.  string describing error otherwise
  5564. '**     NOTE: This function assumes that the caller has already used the 
  5565. '** IsNotesInPath and IsShareEnabled calls and will NOT check to see if 
  5566. '** the modifications are redundant.
  5567. '*************************************************************************
  5568.  
  5569.  
  5570. PUBLIC FUNCTION ModifyAutoexec(modflag%,directmod%,backup$) AS STRING
  5571. DIM     notesdir$,src$,dest$,Buffer$
  5572. DIM srcfile%,destfile%, FoundPath%, PathNext%
  5573.  
  5574.     srcfile% = 112
  5575.     destfile% = 113
  5576.     ModifyAutoexec=""                                                               ' default
  5577.     if (modflag% AND MANotes) then                          ' notes mod
  5578.         notesdir$ = GetNotesPathfromLotusIni()
  5579.     end if
  5580.    src$ = GetBootDrive() 
  5581.    IF src$ <> "" THEN
  5582.       dest$ = src$ + backup$
  5583.       src$ = src$ + "autoexec.bat"
  5584.     ELSE
  5585.       dest$ = "c:\" + backup$
  5586.       src$ = "c:\" + "autoexec.bat"
  5587.    END IF
  5588.  
  5589.     
  5590.     IF Win32CopyFile(src$, dest$, TRUE) = FALSE THEN
  5591.         ModifyAutoexec = LdString( SID_ERR_AUTOEXEC_NOT_COPIED )
  5592.         EXIT FUNCTION
  5593.     End If
  5594.  
  5595.     Win32CopyFile src$, dest$, TRUE
  5596.  
  5597.     if directmod% <> 0 then
  5598.         src$ = dest$
  5599.       dest$ = GetBootDrive()
  5600.       IF dest$ <> "" THEN
  5601.      dest$ = dest$ + "autoexec.bat" 
  5602.       ELSE
  5603.            dest$ = "c:\" + "autoexec.bat"
  5604.       END IF
  5605.    
  5606.     End If
  5607.     OPEN src$ FOR INPUT AS srcfile%
  5608.     OPEN dest$ FOR OUTPUT AS destfile%
  5609.     PathNext% = 0   ' set to 1 when path found, 2 after mod is done.
  5610.     Do Until EOF(srcfile%)
  5611.         LINE INPUT #srcfile%, Buffer$
  5612.         FoundPath% = INSTR(1,LCASE$(Buffer$), "path")
  5613.         if ((FoundPath% <> 0) AND (PathNext <> 2)) Then  ' path statement found.
  5614.             PathNext% = 1
  5615.         end if
  5616.         PRINT #destfile%, Buffer$
  5617.         if PathNext% = 1 Then
  5618.             if (modflag% AND MANotes) then
  5619.                 PRINT #destfile%, "PATH=%PATH%;"+notesdir$
  5620.             End If
  5621.             If (modflag% AND MAShare) then
  5622.                 PRINT #destfile%, "SHARE"
  5623.             End If
  5624.             PathNext% = 2
  5625.         End If
  5626.     Loop
  5627.     if PathNext% <> 2 Then                                                                  ' path statement not found?
  5628.         if (modflag% AND MANotes) then
  5629.             PRINT #destfile%, "PATH=%PATH%;"+notesdir$
  5630.         End If
  5631.         If (modflag% AND MAShare) then
  5632.             PRINT #destfile%, "SHARE"
  5633.         End If
  5634.     End If
  5635.     CLOSE #srcfile%, #destfile%
  5636. END FUNCTION
  5637.  
  5638. '*************************************************************************
  5639. '** FUNCTION GetBootDrive() AS STRING
  5640. '**
  5641. '** Purpose: Gets the boot drive letter and trailing slash (e.g. "C:\")
  5642. '**            
  5643. '** Author:    INSIK RHEE
  5644. '** Arguments: None
  5645. '** Returns:   Searches the fixed drive list for AUTOEXEC.BAT
  5646. '**                        returns null string if none found. (or READ_ONLY drive)
  5647. '*************************************************************************
  5648.  
  5649. PUBLIC FUNCTION GetBootDrive() AS STRING
  5650. DIM lDrive$, Length%, count%
  5651.     GetLocalHardDrivesList SYM_LOCALHARDDRIVES$
  5652.     Length% = GetListLength(SYM_LOCALHARDDRIVES$)
  5653.     FOR count% = 1 TO Length%
  5654.         lDrive$     = GetListItem(SYM_LOCALHARDDRIVES$, count%) + ":\"
  5655.         IF IsDirWritable(lDrive$) AND (DoesFileExist(lDrive$+"autoexec.bat",femExists)=1) THEN
  5656.         GetBootDrive$ = lDrive$
  5657.             EXIT FUNCTION
  5658.         END IF
  5659.     NEXT
  5660.     GetBootDrive$=""
  5661. END FUNCTION
  5662.  
  5663.  
  5664. PUBLIC SUB      DL_SetOraclePath
  5665. '** Purpose:   This subroutine Sets the DataLens specific symbols for the
  5666. '**            ORACLE Home Path.  This facilitates copying the Message file
  5667. '**            to the proper DBS subdirectory location
  5668. '** Author:    PJT
  5669. '** Arguments: NONE
  5670. '*************************************************************************
  5671. 'Should do LOT_ISFeatureINstalled( "SHRORACLEDATA" )
  5672.     DIM TmpDDir$, rc%, lrc&
  5673.     'print "LotusApp Dir: " & GetSymbolValue( SYM_LOTUSAPPDIR$ )    
  5674.     TmpDDir$ = Lot_GetORACLEHomePath() 
  5675.     IF TmpDDir$ <> "" THEN
  5676.        'print "Got ORACLE Home Directory of " & TmpDDir$
  5677.        lrc& = FDirExists ( TmpDDir$ & "\DBS" )
  5678.        'print "Does Directory -" & szTmp$ & "- Exist: " & str( rc% )
  5679.        If (rc% = 1) Then
  5680.       SetSymbolValue SYM_ORACLEHOMEDIR$, TmpDDir$
  5681.        ELSE
  5682.       SetSymbolValue SYM_ORACLEHOMEDIR$, _
  5683.              GetSymbolValue ( SYM_LOTUSAPPDIR$ ) & "DATALENS"
  5684.        End If
  5685.     ELSE
  5686.        SetSymbolValue SYM_ORACLEHOMEDIR$, _
  5687.               GetSymbolValue ( SYM_LOTUSAPPDIR$ ) & "DATALENS"
  5688.     END IF
  5689.     SetSymbolValue "ORACLEHOMEDIR", GetSymbolValue ( SYM_ORACLEHOMEDIR$ )
  5690.     Lot_RefreshDestination(SYM_ORACLEHOMEDIR$)
  5691.     'print "This is the stored Oracle Home dir" & GetSymbolValue( "ORACLEHOMEDIR" )
  5692. END SUB
  5693.  
  5694. PUBLIC SUB      DL_SetNotesDataPath
  5695. '** Purpose:   This subroutine Sets the DataLens specific symbols for the
  5696. '**            Notes Data Path.  This facilitates copying NSF files to the 
  5697. '**            proper DOC location
  5698. '** Author:    PJT
  5699. '** Arguments: NONE
  5700. '*************************************************************************
  5701.     DIM TmpDDir$
  5702.     ' Should use this if NODE or STANDARD - 
  5703.     'print "LotusApp Dir: " & GetSymbolValue( SYM_LOTUSAPPDIR$ )    
  5704.     TmpDDir$ = Lot_GetLotusNotesDataPath() 
  5705.     'print "Got Lotus Notes Data Directory of " & TmpDDir$
  5706.     IF TmpDDir$ <> "" THEN
  5707.        SetSymbolValue SYM_LOTUSNOTESDATADIR$, TmpDDir$
  5708.     ELSE
  5709.        SetSymbolValue SYM_LOTUSNOTESDATADIR$, GetSymbolValue( SYM_LOTUSAPPDIR$ )
  5710.     End If
  5711.     SetSymbolValue "NOTESDATADIR", GetSymbolValue ( SYM_LOTUSNOTESDATADIR$ )
  5712.     Lot_RefreshDestination(SYM_LOTUSNOTESDATADIR$)
  5713.     'print "This is the stored Notes Data dir" & GetSymbolValue( "NOTESDATADIR" )
  5714. END SUB
  5715.  
  5716. PUBLIC FUNCTION Lot_GetLotusNotesDataPath() AS STRING
  5717. '** Purpose:         Returns the location for the Notes Data Directory
  5718. '** Author:          PTilton
  5719. '** Arguments:       None.
  5720. '** Returns:             NULL String if Notes Data Directory not found.
  5721. '**                  Otherwise, returns directory of Notes Data Directory.
  5722. '*************************************************************************
  5723.    DIM szDir$, szSearch$, szTmp$, rc%, lrc&
  5724.  
  5725.    Lot_GetLotusNotesDataPath = ""
  5726.    szTmp$ = GetIniKeyString( "Notes.ini", "Notes", "Directory")
  5727. '   print "Notes Data Directory: " & szTmp$
  5728.    If szTmp$ <> "" Then
  5729.        lrc& = FDirExists ( szTmp$ )
  5730. '          print "Does Directory -" & szTmp$ & "- Exist: " & str( rc% )
  5731.        If (lrc& = 1) Then
  5732.           Lot_GetLotusNotesDataPath = szTmp$
  5733.        End If
  5734.    Else
  5735.       szTmp$ = GetIniKeyString( "Lotus.ini", "Lotus Applications", "Notes")
  5736.       szSearch$ = ucase$( szTmp$ )
  5737.       rc% = instr( szSearch$, "NOTES.EXE") 
  5738.       If rc% > 2 Then
  5739.           szDir$ = left$(szTmp$, rc% - 2 )
  5740. '                 print "Notes LOTUS.INI Data Directory: " & szDir$
  5741.           lrc& = FDirExists ( szDir$ )
  5742. '                 print "Does LOTUS.INI Directory Exist: " & str( lrc& )
  5743.           If (lrc& = 1) Then
  5744.              szTmp$ = GetIniKeyString( szDir$ & "\" & "Notes.ini", "Notes", "Directory")
  5745. '                        print "Notes Data Directory: " & szTmp$
  5746.              If szTmp$ <> "" Then
  5747.                 lrc& = FDirExists ( szTmp$ )
  5748. '                               print "Does Directory -" & szTmp$ & "- Exist: " & str( lrc& )
  5749.                 If (lrc& = 1) Then
  5750.                    Lot_GetLotusNotesDataPath = szTmp$
  5751.                 End If
  5752.          Else
  5753.             Lot_GetLotusNotesDataPath = szDir$
  5754.          End If
  5755.           End If
  5756.       End If
  5757.    End If
  5758. END FUNCTION
  5759. '*************************************************************************
  5760.  
  5761. PUBLIC FUNCTION Lot_GetLotusNotesPrgPath() AS STRING
  5762. '** Purpose:         Returns the location for the Notes Data Directory
  5763. '** Author:          PTilton
  5764. '** Arguments:       None.
  5765. '** Returns:             NULL String if Notes Data Directory not found.
  5766. '**                  Otherwise, returns directory of Notes Data Directory.
  5767. '*************************************************************************
  5768.    DIM szDir$, szSearch$, szTmp$, rc%, lrc&
  5769.    DIM szPath$, szFile$, szSect$, szKey$, szExe$
  5770.  
  5771.    szPath$ = GetSymbolValue( SYM_WINDIR$ ) & LdString( SID_DATALENS_NOTES_INI )
  5772.    szSect$ = LdString( SID_DATALENS_NOTES_SECT )
  5773.    szKey$ = LdString( SID_DATALENS_NOTES_KEY )
  5774.    szExe$ = LdString( SID_DATALENS_NOTES_EXE )
  5775.  
  5776.    Lot_GetLotusNotesPrgPath = ""
  5777.    szTmp$ = GetIniKeyString( szPath$, szSect$, szKey$ )
  5778.    szSearch$ = ucase$( szTmp$ )
  5779.    rc% = instr( szSearch$, szExe$) 
  5780.    If rc% > 2 Then
  5781.       szDir$ = left$(szTmp$, rc% - 2 )
  5782.       'print "Notes LOTUS.INI Program Directory: " & szDir$
  5783.       lrc& = FDirExists ( szDir$ )
  5784.       'print "Does LOTUS.INI Program Directory Exist: " & str( rc% )
  5785.       If (lrc& = 1) Then
  5786.      Lot_GetLotusNotesPrgPath = szDir$
  5787.       End If
  5788.    End If
  5789. END FUNCTION
  5790. '*************************************************************************
  5791.  
  5792. 'FUNCTION GetLotusNotesDataPath(szFile$, szSect$, szKey$) AS STRING
  5793. '** Purpose:         Returns the location for the Notes Data Directory
  5794. '** Author:          PTilton
  5795. '** Arguments:       None.
  5796. '** Returns:             NULL String if Notes Data Directory not found.
  5797. '**                  Otherwise, returns directory of Notes Data Directory.
  5798. '*************************************************************************
  5799. '   DIM szDir$, rc%
  5800.  
  5801. '   GetLotusNotesDataPath = ""
  5802.    
  5803. '   rc% = DoesIniSectionExist (szFile$, szSect$) 
  5804. '   print "Does Section [" & szSect$ & "] Exist in File("& szFile$ &": " & str( rc% )
  5805. '   If (rc% = 1) Then
  5806. '      rc% = DoesIniKeyExist (szFile$, szSect$, szKey$)
  5807. '      print "Does Key -" & szKey$ & "- Exist: " & str( rc% )
  5808. '      If (rc% = 1) Then
  5809. '         szDir$ = GetIniKeyString (szFile$, szSect$, szKey$)
  5810. '         print "Keyword -" & szKey$ & "- Value: " & szDir$
  5811. '         GetLotusNotesDataPath =szDir$
  5812. '      End If
  5813. '   End If
  5814. 'END FUNCTION
  5815. '*************************************************************************
  5816.  
  5817.  
  5818. PUBLIC FUNCTION Lot_GetORACLEHomePath() AS STRING
  5819. '** Purpose:         Returns the location for the ORACLE Home Directory
  5820. '** Author:          PTilton
  5821. '** Arguments:       None.
  5822. '** Returns:             NULL String if ORACLE Home Directory not found.
  5823. '**                  Otherwise, returns directory of ORACLE Home Directory.
  5824. '*************************************************************************
  5825.    DIM szPath$, szTmp$, rc%, lrc&, szFile$, szSect$, szKey$
  5826.  
  5827.    szPath$ = GetSymbolValue( SYM_WINDIR$ ) & LdString( SID_DATALENS_ORACLE_INI )
  5828.    szSect$ = LdString( SID_DATALENS_ORACLE_SECT )
  5829.    szKey$ = LdString( SID_DATALENS_ORACLE_KEY )
  5830.    Lot_GetORACLEHomePath = ""
  5831.    szTmp$ = GetIniKeyString ( szPath$, szSect$, szKey$ )
  5832.    'print "Oracle Home Directory: " & szTmp$
  5833.    If szTmp$ <> "" Then
  5834.        lrc& = FDirExists ( szTmp$ )
  5835.        'print "Does Directory -" & szTmp$ & "- Exist: " & str( lrc& )
  5836.        If (lrc& = 1) Then
  5837.           Lot_GetORACLEHomePath = szTmp$
  5838.        End If
  5839.    End If
  5840. END FUNCTION
  5841. '*************************************************************************
  5842.  
  5843. PUBLIC FUNCTION Lot_IsDestVerNewerOrEqual(DestinationPath$,sourcever1&,sourcever2&,sourcever3&,sourcever4&) AS INTEGER
  5844. '** Purpose:   This function validates the version of the file
  5845. '** Author:    MZ
  5846. '** Arguments: DestinationPath$,
  5847. '**            SourceVer1&,
  5848. '**            SourceVer2&,
  5849. '**            SourceVer3&,
  5850. '**            SourceVer4&
  5851. '** Returns:   1 if newer or equal
  5852. '**            0 if older or the file is not found or it does not have version
  5853. '*************************************************************************
  5854.    DIM DestFileVersion$
  5855.    DIM DestVer1&,DestVer2&,DestVer3&,DestVer4&, notused%
  5856.  
  5857.    'Find If the file exists
  5858.    IF DoesFileExist(DestinationPath$,femExists)=1 THEN
  5859.  
  5860.       'Find the version
  5861.       DestFileVersion$=GetVersionOfFile(DestinationPath$)
  5862.  
  5863.       'If no version found
  5864.       IF DestFileVersion$="" THEN
  5865.      Lot_IsDestVerNewerOrEqual = 0
  5866.      EXIT FUNCTION
  5867.  
  5868.       'If version found
  5869.       ELSE
  5870.      'Find the version components
  5871.      DestVer1&=GetVersionNthField(DestFileVersion$,1)
  5872.      DestVer2&=GetVersionNthField(DestFileVersion$,2)
  5873.      DestVer3&=GetVersionNthField(DestFileVersion$,3)
  5874.      DestVer4&=GetVersionNthField(DestFileVersion$,4)
  5875.  
  5876.      'Compare the version
  5877.      IF SourceVer1& > DestVer1& THEN
  5878.         Lot_IsDestVerNewerOrEqual = 0
  5879.         EXIT FUNCTION
  5880.      ELSEIF SourceVer1& = DestVer1& AND _
  5881.         SourceVer2& > DestVer2& THEN
  5882.         Lot_IsDestVerNewerOrEqual = 0
  5883.         EXIT FUNCTION
  5884.      ELSEIF SourceVer1& = DestVer1& AND _
  5885.         SourceVer2& = DestVer2& AND _
  5886.         SourceVer3& > DestVer3& THEN
  5887.         Lot_IsDestVerNewerOrEqual = 0
  5888.         EXIT FUNCTION
  5889.      ELSEIF SourceVer1& = DestVer1& AND _
  5890.         SourceVer2& = DestVer2& AND _
  5891.         SourceVer3& = DestVer3& AND _
  5892.         SourceVer4& > DestVer4& THEN
  5893.         Lot_IsDestVerNewerOrEqual = 0
  5894.         EXIT FUNCTION
  5895.      ELSEIF SourceVer1& = DestVer1& AND _
  5896.         SourceVer2& = DestVer2& AND _
  5897.         SourceVer3& = DestVer3& AND _
  5898.         SourceVer4& = DestVer4& THEN
  5899.         'Version is equal. Delete the source
  5900.         Lot_IsDestVerNewerOrEqual = 1
  5901.         EXIT FUNCTION
  5902.      ELSE
  5903.         'Dest is newer.
  5904.         Lot_IsDestVerNewerOrEqual = 1
  5905.         EXIT FUNCTION
  5906.      END IF
  5907.  
  5908.       END IF
  5909.    'file not found in the destination
  5910.    ELSE
  5911.       Lot_IsDestVerNewerOrEqual = 0
  5912.       EXIT FUNCTION
  5913.    END IF
  5914. END FUNCTION
  5915.  
  5916. SUB PopulateCINSTALLLIST
  5917.    DIM prodDir$, installIniFile$, FeaturePref$, Featurenumber%
  5918.    DIM FeatureTag$, FeatureID$, rc%
  5919.    STATIC gCINSTALLinited%  ''ASSUME gCINSTALLinited% starts as zero
  5920.  
  5921.    If  gCINSTALLinited% <> 1 Then
  5922.       gNCINSTALL% = 0
  5923.       gCINSTALLinited% = 1
  5924.  
  5925.       'Built the path to install.ini
  5926.       prodDir$ = Lot_GetInstallDir()
  5927.       installIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  5928.  
  5929.       FeaturePref$ = "Feature"
  5930.       FeatureNumber%=1
  5931.       FeatureTag$=FeaturePref$+LTRIM$(STR$(FeatureNumber%))
  5932.       FeatureID$ = GetIniKeyString(installIniFile$,"Server Feature Installed", FeatureTag$)
  5933.       IF DoesFileExist(installIniFile$,femExists) = 1 THEN
  5934.     IF FeatureID$ <> "" THEN
  5935.        DO
  5936.           CINSTALL (FeatureID$) = "1"
  5937.           gNCINSTALL% = gNCINSTALL%+1
  5938.           FeatureNumber% = FeatureNumber% + 1
  5939.           FeatureTag$=FeaturePref$+LTRIM$(STR$(FeatureNumber%))
  5940.           FeatureID$ = GetIniKeyString(installIniFile$,"Server Feature Installed", FeatureTag$)
  5941.        LOOP UNTIL FeatureID$ = ""
  5942.         END IF
  5943.       ELSE
  5944.      '** DND: Look into using ShowPathError here. We should tell the
  5945.      '**      user where we looked for install.ini
  5946.      FatalErrorMsg SID_ERR_INSTALLINI_MISSING, "", STFQUIT
  5947.       END IF
  5948.    END IF
  5949. END SUB
  5950.  
  5951. '*************************************************************************
  5952. SUB PopulateCINSTNODELIST
  5953.    DIM prodDir$, installIniFile$, FeaturePref$, Featurenumber%
  5954.    DIM FeatureTag$, FeatureID$, rc%, dirSym$, inidir$
  5955.    STATIC gCINSTNODEinited%  ''ASSUME gCINSTALLinited% starts as zero
  5956.  
  5957.    If  gCINSTNODEinited% <> 1 Then
  5958.       gNCINSTNODE% = 0
  5959.       gCINSTNODEinited% = 1
  5960.  
  5961.       'Built the path to cinstnod.ini
  5962.       dirSym$ = Reg_GetDirSymbolList(1)       '** First product dir list
  5963.       IF GetListLength(dirSym$) >= 1 THEN
  5964.         dirSym$ = GetListItem(dirSym$, 1)    '** First directory symbol
  5965.         inidir$ = GetSymbolValue(dirSym$) 
  5966.               installIniFile$ = MakePath(inidir$,"cinstnod.ini")
  5967.       END IF
  5968.  
  5969.       FeaturePref$ = "Feature"
  5970.       FeatureNumber%=1
  5971.       FeatureTag$=FeaturePref$+LTRIM$(STR$(FeatureNumber%))
  5972.       FeatureID$ = GetIniKeyString(installIniFile$,"Server Feature Installed", FeatureTag$)
  5973.       IF DoesFileExist(installIniFile$,femExists) = 1 THEN
  5974.     IF FeatureID$ <> "" THEN
  5975.        DO
  5976.           CINSTNODE (FeatureID$) = "1"
  5977.           gNCINSTNODE% = gNCINSTNODE%+1
  5978.           FeatureNumber% = FeatureNumber% + 1
  5979.           FeatureTag$=FeaturePref$+LTRIM$(STR$(FeatureNumber%))
  5980.           FeatureID$ = GetIniKeyString(installIniFile$,"Server Feature Installed", FeatureTag$)
  5981.        LOOP UNTIL FeatureID$ = ""
  5982.         END IF
  5983.       ELSE
  5984.      '** DND: Look into using ShowPathError here. We should tell the
  5985.      '**      user where we looked for install.ini
  5986.      FatalErrorMsg SID_ERR_INSTALLINI_MISSING, "", STFQUIT
  5987.       END IF
  5988.    END IF
  5989. END SUB
  5990.  
  5991. '*************************************************************************
  5992. '** PUBLIC FUNCTION TrimNetlotusapp (path$) AS STRING
  5993. '**
  5994. '** Purpose:   trims the net lotusapp directory to detect mapping. 
  5995. '** Author:    Thangv
  5996. '** Arguments: path$ 
  5997. '** Returns:   the modified path
  5998. '*************************************************************************
  5999.  
  6000. PUBLIC FUNCTION TrimNetlotusapp (ByVal path$) AS STRING
  6001.  
  6002.    DIM  firstslash%, newpath$, drive$
  6003.    
  6004.    TrimNetlotusapp = ""
  6005.    path$ = Lot_TrimEndSlash (path$)
  6006.    drive$ = LEFT(path$, 2)
  6007.    
  6008.    firstslash% = INSTR(1,path$,"\")
  6009.    WHILE firstslash% <> 0
  6010.       path$ = MID$(path$,firstslash%+1)
  6011.       newpath$ = drive$ + "\" + path$
  6012.       IF DoesDirExist(newpath$) = 1 THEN
  6013.      TrimNetlotusapp = newpath$ + "\"
  6014.      EXIT FUNCTION     
  6015.       ELSE 
  6016.      firstslash% = INSTR(1,path$,"\")                       
  6017.       END IF
  6018.    WEND
  6019.  
  6020. END FUNCTION
  6021.  
  6022. PUBLIC FUNCTION Lot_RegisterUninstaller(ProdRegKeyName$,ProdVer$,_
  6023.                     ProdDisplayedName$,ProdInfPath$,_
  6024.                     LogFlag%,AutoFlag%,_
  6025.                     LangID$,LogFile$,RspFile$,_
  6026.                     UserName$ ) AS INTEGER
  6027. '** Purpose:   Registers the uninstaller for a product and builds the uninstall
  6028. '**            command line. This function should be called in PostCopyConfig()
  6029. '** Author:    MZ
  6030. '** Arguments: ProdRegKeyName$     The name of the product key in the registry
  6031. '**            ProdVer$            The version of the product installed
  6032. '**            ProdDisplayedName$  The description of the product put into the registry
  6033. '**            ProdInfPath$        The path of the standalone/server INF file
  6034. '**            LogFlag%            TRUE/FALSE if you want uninstall to produce or not a log
  6035. '**            AutoFlag%           TRUE/FALSE if you want uninstall to run or not silantelly
  6036. '**            LangID$             The default language for uninstall
  6037. '**            LogFile$ (optional) The log file path to overwrite the default provided by uninstall
  6038. '**            RspFile$ (optional) The response file path to overwrite the default provided by uninstall
  6039. '**            UserName$(optional) The User Name
  6040. '** Returns:   True if worked False otherwise
  6041. '*************************************************************************
  6042. DIM gInstallIniFile$,cwd$,prodDir$,Network$,ProdNameAndVer$,CommandLine$ 
  6043. DIM Platform%, PlatformStr$, LReturn&, grouptitle$, Caption$, dirSym$, RegKey$
  6044.  
  6045.    'Validate the arguments
  6046.    IF ProdRegKeyName$ = "" OR _
  6047.       ProdVer$ = "" OR _
  6048.       ProdDisplayedName$ = "" OR _
  6049.       ProdInfPath$ = "" OR _
  6050.       LangID$ = "" THEN
  6051.       Lot_RegisterUninstaller = FALSE
  6052.    END IF
  6053.  
  6054.    IF LogFlag% <> FALSE AND LogFlag% <> TRUE THEN
  6055.       Lot_RegisterUninstaller = FALSE
  6056.    END IF
  6057.  
  6058.    IF AutoFlag% <> FALSE AND AutoFlag% <> TRUE THEN
  6059.       Lot_RegisterUninstaller = FALSE
  6060.    END IF
  6061.    
  6062.    Network$ = GetSymbolValue(SYM_NETWORK$)
  6063.  
  6064.  'TV: For server, distribution installs don't register uninstall
  6065.  IF Network$ <> gSERVER$ AND Network$ <> gDISTRIBUTION$ THEN            
  6066.  
  6067.    'Built the path to cinstall.ini
  6068.    IF Network$ = gNODE$ THEN
  6069.       'Get the target directory for the product
  6070.       dirSym$ = Reg_GetDirSymbolList(Lot_GetCurrentProduct())
  6071.       If GetListLength(dirSym$) >= 1 Then
  6072.          dirSym$ = GetListItem(dirSym$, 1)
  6073.          gInstallIniFile$ = GetSymbolValue(dirSym$)+"Cinstnod.ini"
  6074.       End If
  6075.    ELSEIF Network$=gSERVER$ OR Network$=gSTANDARD THEN
  6076.       'Get the install directory
  6077.       prodDir$ = Lot_GetInstallDir()
  6078.       gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  6079.    END IF
  6080.  
  6081.    'print gInstallIniFile$,"gInstallIniFile$"
  6082.    PlatformStr$ = gREGWINNAME
  6083.  
  6084.    'Write the uninstall key and registry values
  6085.     RegKey$=PlatformStr$+"\Uninstall\"+ProdRegKeyName$+" V"+ProdVer$
  6086.    LReturn& = Lot_RegCreateKeyEx(HKEY_LOCAL_MACHINE, RegKey$)
  6087.   'print " after calling Lot_RegCreateKeyEx in share32",LReturn&
  6088.   IF LReturn& <> ERROR_SUCCESS THEN
  6089.      Lot_RegisterUninstaller = FALSE
  6090.       RegErrorMsg SID_ERR_REG_CREATE, gHLM$+"\"+RegKey$,"",""
  6091.   END IF
  6092.         
  6093.   'Write the display name key and value
  6094.   'print " before calling Lot_CreateRegKeyValueEx in share32"        
  6095.   LReturn& = Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, RegKey$,_
  6096.               "DisplayName",_
  6097.               REG_SZ,_
  6098.               ProdDisplayedName$, _
  6099.               LENBP(ProdDisplayedName$)+1) ''** HISHI - Aug/23/95
  6100.   'print " after calling Lot_CreateRegKeyValueEx in share32",LReturn&
  6101.   IF LReturn& <> ERROR_SUCCESS THEN
  6102.       Lot_RegisterUninstaller = FALSE
  6103.        RegErrorMsg SID_ERR_REG_UNINST, gHLM$+RegKey$,"DisplayName",ProdDisplayedName$
  6104.   END IF
  6105.  
  6106.   'Build the command line
  6107.   CommandLine$ = " /T "+ProdRegKeyName+" /V "+ProdVer$+" /I "+ProdInfPath$
  6108.   CommandLine$ = CommandLine$+" /C "+gInstallIniFile$   
  6109.   IF LogFlag% <> FALSE THEN
  6110.      CommandLine$ = CommandLine$+" /O "
  6111.   END IF
  6112.   IF LogFile$ <> "" THEN
  6113.      CommandLine$ = CommandLine$+LogFile$
  6114.   END IF
  6115.   IF AutoFlag% <> FALSE THEN
  6116.      CommandLine$ = CommandLine$+" /A "
  6117.   END IF
  6118.   IF RspFile$ <> "" THEN
  6119.      CommandLine$ = CommandLine$+RspFile$
  6120.   END IF
  6121.   CommandLine$ = CommandLine$+" /L "+LangID$
  6122.   IF UserName$ <> "" THEN
  6123.      CommandLine$ = CommandLine$+" /U "+UserName$
  6124.   END IF    
  6125.   CommandLine$ = GetWindowsDir()+gUNINSTALLEXE+CommandLine$
  6126.  
  6127.   IF NOT IsNewShell() THEN
  6128.         Caption$ = ProdRegKeyName$+" V"+ProdVer$+" "+gUNINSTALL
  6129.       grouptitle$ = Reg_GetProgManagerGroupName(1)
  6130.     CreateProgmanItem grouptitle$, Caption$, CommandLine$, GetWindowsDir()+gUNINSTALLEXE, cmoOverwrite
  6131.     Lot_RegisterObject gUNSTTOP, UNIN_CLASS_ICON$, grouptitle$ + "\" + Caption$
  6132.   END IF
  6133.  
  6134.   'print CommandLine$,"CommandLine$"
  6135.   'Write the CommandLine
  6136.   'print " before calling Lot_CreateRegKeyValueEx in share32"        
  6137.   LReturn& = Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, RegKey$,_
  6138.               "UninstallString",_
  6139.               REG_SZ,_
  6140.               CommandLine$, _
  6141.               LENBP(CommandLine$)+1) ''** HISHI - Aug/23/95
  6142.   'print " after calling Lot_CreateRegKeyValueEx in share32",LReturn&        
  6143.  
  6144.   IF LReturn& <> ERROR_SUCCESS THEN
  6145.       Lot_RegisterUninstaller = FALSE
  6146.        RegErrorMsg SID_ERR_REG_UNINST, gHLM$+RegKey$,"UninstallString",CommandLine$
  6147.   ELSE
  6148.       Lot_RegisterUninstaller = TRUE
  6149.   END IF
  6150.  END IF
  6151.  
  6152. END FUNCTION
  6153.  
  6154. PUBLIC FUNCTION Lot_RegisterObject(FeatureKeyWord$, ClassOfObject$, ObjectPath$)
  6155. '** Purpose:   Registers the [Miscellaneous Installed Objects] into cinstall.ini 
  6156. '**            for standalone installs and into cinsnode.ini for node installs
  6157. '** Author:    MZ
  6158. '** Arguments: FeatureKeyWord$     The KeyWord of the section that is associate 
  6159. '**                                with this object
  6160. '**            ClassOfObject$      The classes; The predefined (in globals.lss)
  6161. '**                                classes are: 
  6162. '**                                UNIN_CLASS_PROGRAM_GROUP$
  6163. '**                                UNIN_CLASS_ICON$
  6164. '**                                UNIN_CLASS_FOLDER$
  6165. '**                                UNIN_CLASS_SHORTCUT$
  6166. '**                                UNIN_CLASS_START_MENU_ENTRY$
  6167. '**                                UNIN_CLASS_REGISTRY_KEY$
  6168. '**                                UNIN_CLASS_REGISTRY_VALUE$
  6169. '**                                UNIN_CLASS_REGISTRY_HIVE$
  6170. '**                                UNIN_CLASS_FILE$
  6171. '**                                UNIN_CLASS_FILE_GROUP$
  6172. '**                                UNIN_CLASS_DIRECTORY$
  6173. '** Returns:   True if worked False otherwise
  6174. '*************************************************************************
  6175. DIM gInstallIniFile$,inidir$, s$,Network$
  6176. DIM NodeInstIniFile$,iniPath$,ObjectNum%,lrc&, ObjectPref$
  6177. DIM ObjectTag$, ObjectID$, LastObjectNumber%, dirSym$, temp%
  6178.  
  6179.    'Get the install type
  6180.    Network$ = GetSymbolValue(SYM_NETWORK$)
  6181.    s$ = GetSymbolValue(SYM_SINGLESMARTSUITE$)
  6182.  
  6183.     IF NOT IsNewShell() AND ClassOfObject$ = UNIN_CLASS_ICON$ THEN
  6184.         temp% = INSTR(ObjectPath$, "\")
  6185.         IF LEN(ObjectPath$) > temp%+40 THEN
  6186.             ObjectPath$ = LEFT$(ObjectPath$, temp%+40)
  6187.         END IF
  6188.     END IF
  6189.  
  6190.    'TV: For server and distribution installs don't register any objects
  6191.    IF Network$ <> gSERVER$ AND Network$ <> gDISTRIBUTION$ THEN          
  6192.       'Built the path to cinstall.ini (in standalone case) 
  6193.       'or cinstnod.ini (in NODE case)
  6194.       IF Network$ = gNODE$ AND s$ = gSMARTSUITE$ THEN
  6195.      inidir$ = GetSymbolValue(SYM_BASEDIR$)
  6196.      NodeInstIniFile$ = inidir$+"cinstnod.ini"
  6197.      iniPath$ = NodeInstIniFile$
  6198.       ELSEIF Network$ = gNODE$ AND s$ = gSINGLE$ THEN
  6199.      dirSym$ = Reg_GetDirSymbolList(1)       '** First product dir list
  6200.      IF GetListLength(dirSym$) >= 1 THEN
  6201.         dirSym$ = GetListItem(dirSym$, 1)    '** First directory symbol
  6202.         inidir$ = GetSymbolValue(dirSym$) 
  6203.         NodeInstIniFile$ = inidir$+"cinstnod.ini"
  6204.         iniPath$ = NodeInstIniFile$
  6205.      ELSE
  6206.         inidir$ = GetSymbolValue(SYM_STF_CWDDIR$)
  6207.         NodeInstIniFile$ = inidir$+"cinstnod.ini"
  6208.         iniPath$ = NodeInstIniFile$
  6209.      END IF
  6210.  
  6211.       ELSEIF Network$=gSTANDARD THEN
  6212.     'Get the install directory
  6213.     inidir$ = Lot_GetInstallDir()
  6214.     gInstallIniFile$ = MakePath(inidir$,gINSTALLINI$)
  6215.     iniPath$ = gInstallIniFile$
  6216.       END IF
  6217.       'print iniPath$,"IniPath$"
  6218.  
  6219.       'Get last object number
  6220.       ObjectPref$ = "Object"
  6221.       ObjectNum%=1
  6222.       ObjectTag$=ObjectPref$+LTRIM$(STR$(ObjectNum%))
  6223.  
  6224.       lrc& = DoesFileExist(iniPath$,femExists)
  6225.  
  6226.       IF lrc& = 1 THEN
  6227.     ObjectID$ = GetIniKeyString(iniPath$,_
  6228.                   "Miscellaneous Installed Objects", _
  6229.                   ObjectTag$)
  6230.     IF ObjectID$ = "" THEN
  6231.        LastObjectNumber% = 0
  6232.     ELSE   
  6233.        WHILE (ObjectID$ <> "")
  6234.            ObjectNum% = ObjectNum% + 1
  6235.            ObjectTag$ = ObjectPref$+LTRIM$(STR$(ObjectNum%))
  6236.            ObjectID$  = GetIniKeyString(iniPath$,_
  6237.                         "Miscellaneous Installed Objects", _
  6238.                         ObjectTag$)
  6239.        WEND
  6240.        LastObjectNumber% = ObjectNum%-1
  6241.     END IF
  6242.       ELSE      
  6243.        LastObjectNumber% = 0
  6244.       END IF
  6245.       'print LastObjectNumber%,"LastObjectNumber%"
  6246.  
  6247.       'Write a new object
  6248.       CreateIniKeyValue iniPath$, _
  6249.              "Miscellaneous Installed Objects",_
  6250.              "Object"+LTRIM$(STR$(LastObjectNumber%+1)), _
  6251.              FeatureKeyWord$+","+ClassOfObject$+","+ObjectPath$, _
  6252.              cmoOverwrite
  6253.    END IF
  6254.  
  6255. END FUNCTION
  6256. '*************************************************************************
  6257. PUBLIC FUNCTION Lot_GetDestDirValueFromInstallini(DestDirSym$) AS STRING
  6258. '**
  6259. '** Purpose:   trims the net lotusapp directory to detect mapping. 
  6260. '** Author:    Thangv, PD
  6261. '** Arguments: path$ 
  6262. '** Returns:   the modified path
  6263. '*************************************************************************
  6264. DIM DestDirSymVal$, iniPath$, rv%, source$
  6265. DIM gInstallIniFile$,inidir$
  6266. DIM uncvol$, dirPath$
  6267.  
  6268.     Lot_GetDestDirValueFromInstallini = ""
  6269.     'Get the install directory
  6270.     inidir$ = Lot_GetInstallDir()
  6271.     gInstallIniFile$ = MakePath(inidir$,gINSTALLINI$)
  6272.     iniPath$ = gInstallIniFile$
  6273.     DestDirSymVal$ = GetIniKeyString(iniPath$,_
  6274.                  "Destination Symbols And Values", _
  6275.                  DestDirSym$)
  6276.     IF  DestDirSymVal$ <> "" THEN
  6277.         rv% = DoesDirExist(DestDirSymVal$)
  6278.         IF rv% = 0 THEN
  6279.                 '** TV: shouldn't get here even if destdirSymVal is UNC
  6280.         source$ =  GetSymbolValue(SYM_STF_SRCDIR$)
  6281.                 IF NOT Lot_IsUnvalidatedUNCPath(source$) THEN
  6282.                 DestDirSymVal$ = MID$(source$,1,1)+MID$(DestDirSymVal$,2)
  6283.                 ELSE
  6284.                         Lot_SplitUNCPath source$, uncvol$, dirPath$
  6285.                 DestDirSymVal$ = uncvol$ + MID$(DestDirSymVal$,3)
  6286.                 END IF        
  6287.         rv% = Lot_CleanPath(DestDirSymVal$)
  6288.  
  6289.             IF rv% = 0 THEN
  6290.                   ErrorMsg SID_ERR_NODENETMAP, ""
  6291.                   ERROR STFQUIT
  6292.         END IF
  6293.         END IF
  6294.     END IF
  6295.  
  6296.     Lot_GetDestDirValueFromInstallini = DestDirSymVal$
  6297. END FUNCTION
  6298.  
  6299. '*************************************************************************
  6300. PUBLIC SUB      Lot_WriteCriticalDirectories (InstallInifile$)
  6301. '**
  6302. '** Purpose:   writes out the critical directories for uninstall in 
  6303. '**            cinstall.ini, cinstnod.ini   
  6304. '** Author:    Thangv
  6305. '** Arguments: path to cinstall.ini/cinstnod.ini file 
  6306. '** Returns:   
  6307. '*************************************************************************
  6308.    DIM dirsyms%, gInstallIniFile$, prodDir$, progdir$
  6309.    DIM prodsym$, AllProdNum%, prodNum%, symList$, i%
  6310.  
  6311.       'the path to install.ini
  6312.       gInstallIniFile$ = InstallInifile$
  6313.  
  6314.    's$ = GetSymbolValue(SYM_SINGLESMARTSUITE$)
  6315.  
  6316.       'Loop through the products and log the directories
  6317.       AllProdNum% = 0
  6318.       AllProdNum% = Reg_GetNumberOfProducts()
  6319.       IF AllProdNum% <> 0 THEN
  6320.      'BaseDir$= GetSymbolValue(SYM_BASEDIR$)
  6321.      FOR prodNum%=1 TO AllProdNum%
  6322.         'ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  6323.         'Get the directory symbol
  6324.         symList$ = Reg_GetDirSymbolList(prodNum%)
  6325.         dirsyms% = GetListLength(symList$)
  6326.         FOR i% = 1 TO dirsyms% 
  6327.         prodsym$ = GetListItem(symList$, i%)
  6328.         progdir$ = GetSymbolValue(prodsym$)
  6329.         CreateIniKeyValue gInstallIniFile$, "Critical Directories", prodsym$, progdir$, cmoOverWrite
  6330.         NEXT
  6331.      NEXT
  6332.       END IF
  6333. END SUB
  6334.  
  6335.  
  6336. PUBLIC FUNCTION GetLastPathComponent( ByVal szPath$) AS STRING
  6337. '**
  6338. '** Purpose:   Returns the last component of a path
  6339. '**
  6340. '** Author:    GJL
  6341. '** Arguments: path 
  6342. '** Returns: The last dir name or file name, empty string if path
  6343. '**          ends in \
  6344. '*************************************************************************
  6345.     DIM offSet&, nextOff&
  6346.  
  6347.     GetLastPathComponent$ = szPath$
  6348.     offSet& = InStr(szPath$,"\")
  6349.     nextOff& = offSet&
  6350.  
  6351.     DO WHILE nextOff& <> 0
  6352.        nextOff = InStr(Mid$(szPath$,offset),"\")
  6353.        offSet& = offSet& + nextOff& 
  6354.  
  6355.     LOOP
  6356.     IF offSet& > 0 THEN
  6357.       GetLastPathComponent$ = Mid$(szPath$,offSet&)
  6358.     END IF
  6359. END FUNCTION
  6360.  
  6361. '*************************************************************************
  6362. FUNCTION Lot_AddToNTSystemPath(RegH&, RegKey$, VarName$, ByVal AddPath$) AS INTEGER
  6363.     DIM NewPath$, notused&, PathDir$
  6364.     DIM RegValLen&, Pos%, Resave%
  6365.  
  6366.     Lot_AddToNTSystemPath = 1
  6367.  
  6368.     If Lot_DoesRegKeyExistEx(RegH&, RegKey$) = FALSE THEN
  6369.         If Lot_RegCreateKeyEx(RegH&, RegKey$) <> 0 Then
  6370.             Lot_AddToNTSystemPath = 0
  6371.             EXIT FUNCTION
  6372.         End If
  6373.         NewPath = ""
  6374.     Else
  6375.         RegValLen&=CLNG(1024)
  6376.         NewPath$=CreateBuffer(RegValLen&)
  6377.         if Lot_GetRegKeyValueEx(RegH&, RegKey$, VarName$,_
  6378.                 REG_EXPAND_SZ&,NewPath$,RegValLen&) <> 0 Then
  6379.             NewPath = ""
  6380.         End If
  6381.     End If
  6382.  
  6383.     NewPath$ = NullTrim(NewPath$)        
  6384.     Resave%=0
  6385.     Do While AddPath$ <> ""
  6386.         Pos%=InStr(AddPath$,";")
  6387.  
  6388.         If Pos=0 Then
  6389.             PathDir$ = AddPath$
  6390.             AddPath = ""
  6391.         Else
  6392.             PathDir$ = Left$(AddPath$, Pos%-1)
  6393.             If RIGHT$(PathDir$,1) = "\" Then
  6394.                 PathDir$ = LEFT$(PathDir$, LEN(PathDir$)-1)
  6395.             End If
  6396.             AddPath = Right$(AddPath$, LEN(AddPath)-Pos%)
  6397.         End If
  6398.  
  6399.         If InStr(NewPath$,PathDir$) = 0 Then
  6400.            If NewPath = "" Then
  6401.                 NewPath=PathDir$
  6402.             Else
  6403.                 NewPath=NewPath$+";"+PathDir$
  6404.             End If
  6405.             Resave%=1
  6406.         End If
  6407.     Loop
  6408.     If Resave%=1 Then
  6409.         If Lot_CreateRegKeyValueEx(RegH&, RegKey$, VarName$,_
  6410.                REG_EXPAND_SZ&,NewPath$,LEN(NewPath$)+1) Then
  6411.             Lot_AddToNTSystemPath = 0
  6412.         End If
  6413.     End If
  6414.  
  6415. END FUNCTION
  6416.  
  6417. '*************************************************************************
  6418. PUBLIC FUNCTION Lot_RegAppPath(ProgName$, szProgPath$, ByVal szSearchPath$, ByVal fCompPath%, ByVal KeyWord$) AS INTEGER
  6419.  
  6420. '** Purpose:   Add application path to registry
  6421. '** Author:    OM
  6422. '** Arguments: 
  6423. '**        ProgName$:        Name of the program file
  6424. '**        szProgPath$:   This is the path of program named above. It
  6425. '**                            may be entered with or without the final '\'
  6426. '**        szSearchPath$: Directories separated by ';' to be added to search
  6427. '**                            path.  Directories should not have final '\'.
  6428. '**        fCompPath:        True if component path should be added to search
  6429. '**                            path.  False if not.
  6430. '**      KeyWord$:        The feature keyword associated with this object.
  6431. '**                            For example, "FLWCORE"
  6432. '**
  6433. '** Returns:   True if worked False otherwise
  6434. '*************************************************************************
  6435.     DIM RegKey$, RegH&, PathDir$, notused&, s$, network$ 
  6436.  
  6437.     szSearchPath$ = NullTrim(szSearchPath$)
  6438.     szSearchPath$ = LTrim(szSearchPath$)
  6439.     If fCompPath% Then
  6440.         network$ = GetSymbolValue(SYM_NETWORK$)
  6441.         IF network$ = gNODE$ THEN
  6442.             s$ = GetSymbolValue(SYM_NETCOMPONENT$)
  6443.         ELSE
  6444.             s$ = GetSymbolValue(SYM_COMPONENTSDIR$)
  6445.         END IF
  6446.         szSearchPath$ = szSearchPath$+";" + s$
  6447.         szSearchPath$ = NullTrim(szSearchPath$)
  6448.         szSearchPath$ = LEFT$(szSearchPath$,LEN(szSearchPath$)-1)
  6449.     End If
  6450.     
  6451.     Lot_RegAppPath = 1
  6452.  
  6453.     RegH&=HKEY_LOCAL_MACHINE&
  6454.     RegKey$=gREGWINNAME+gREGAPPPATH95+"\"+ProgName$
  6455.     If Lot_DoesRegKeyExistEx(RegH&, RegKey$) = FALSE THEN
  6456.         notused&=Lot_RegCreateKeyEx(RegH&, RegKey$)
  6457.     End If
  6458.     If NOT RIGHT$(szProgPath$,1) = "\" Then
  6459.         szProgPath$ = szProgPath$ + "\"
  6460.     End If
  6461.     PathDir$ = szProgPath+ProgName$
  6462.     if Lot_CreateRegKeyValueEx(RegH&,RegKey$,"",_
  6463.             REG_SZ,PathDir$,LEN(PathDir$)+1) OR _
  6464.          Lot_CreateRegKeyValueEx(RegH&,RegKey$,gREGAPPPATH95PATH,_
  6465.             REG_SZ,szSearchPath$,LEN(szSearchPath$)+1) Then
  6466.         Lot_RegAppPath = 0
  6467.     Else
  6468.         RegKey$ = gHLM$+"\"+RegKey$
  6469.         Lot_RegisterObject KeyWord$, UNIN_CLASS_REGISTRY_HIVE$, RegKey$
  6470.     End If        
  6471.  
  6472.     If NOT IsNewShell() Then
  6473.         If Lot_AddToNTSystemPath(HKEY_LOCAL_MACHINE&, _
  6474.             gREGAPPPATHNT1, gREGAPPPATHNTPATH, szSearchPath$) = 0 Then
  6475.             If Lot_AddToNTSystemPath(HKEY_CURRENT_USER&, _
  6476.                 gREGAPPPATHNT2, gREGAPPPATHNTPATH, szSearchPath$) = 0 Then
  6477.                 Lot_RegAppPath = 0
  6478.             Else
  6479.                 RegKey$ = gHCU$+"\"+gREGAPPPATHNTPATH
  6480. '                Lot_RegisterObject KeyWord$, UNIN_CLASS_REGISTRY_HIVE$, RegKey$
  6481.             End If
  6482.         Else
  6483.             RegKey$ = gHCU$+"\"+gREGAPPPATHNTPATH
  6484. '            Lot_RegisterObject KeyWord$, UNIN_CLASS_REGISTRY_HIVE$, RegKey$
  6485.         End If
  6486.     End If
  6487.     If Lot_RegAppPath = 0 Then
  6488.         RegErrorMsg SID_ERR_REG_APPPATH, RegKey$, gREGAPPPATH95PATH, szSearchPath$
  6489.     End If
  6490. END FUNCTION
  6491. '*************************************************************************
  6492.  
  6493. PUBLIC FUNCTION Lot_SetChapterValInt (ByVal szChapter$,ByVal nField%,ByVal nValue%) AS INTEGER  
  6494. '** Purpose:
  6495. '** Author:
  6496. '** Arguments:
  6497. '** Returns:
  6498. '**     
  6499. '*************************************************************************
  6500.    
  6501.    if FSetChapterValInt(szChapter$, CLng(nField%),nValue%) = 0 then
  6502.        Lot_SetChapterValInt = -1    
  6503.    else
  6504.       Lot_SetChapterValInt = CInt(nValue%)
  6505.    end if
  6506.  
  6507. END FUNCTION
  6508.  
  6509.